]> www.ginac.de Git - ginac.git/commitdiff
fixed some -Wall stuff
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 25 Jun 2001 22:32:26 +0000 (22:32 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 25 Jun 2001 22:32:26 +0000 (22:32 +0000)
ginac/clifford.cpp
ginac/color.cpp
ginac/indexed.cpp
ginac/input_lexer.ll
ginac/matrix.cpp
ginac/normal.cpp
ginac/symmetry.cpp
ginac/tensor.cpp
ginsh/ginsh_parser.yy

index 80d7d3426a58d430ff8b33ccbc88527b2c69b5da..cde94ebd640b080f091ca7b63407444bd5fbd73d 100644 (file)
@@ -378,8 +378,8 @@ static ex trace_string(exvector::const_iterator ix, unsigned num)
        exvector v(num - 2);
        int sign = 1;
        ex result;
        exvector v(num - 2);
        int sign = 1;
        ex result;
-       for (int i=1; i<num; i++) {
-               for (int n=1, j=0; n<num; n++) {
+       for (unsigned i=1; i<num; i++) {
+               for (unsigned n=1, j=0; n<num; n++) {
                        if (n == i)
                                continue;
                        v[j++] = ix[n];
                        if (n == i)
                                continue;
                        v[j++] = ix[n];
@@ -406,7 +406,6 @@ ex dirac_trace(const ex & e, unsigned char rl, const ex & trONE)
                ex prod = _ex1();
                for (unsigned i=0; i<e.nops(); i++) {
                        const ex &o = e.op(i);
                ex prod = _ex1();
                for (unsigned i=0; i<e.nops(); i++) {
                        const ex &o = e.op(i);
-                       unsigned ti = o.return_type_tinfo();
                        if (is_clifford_tinfo(o.return_type_tinfo(), rl))
                                prod *= dirac_trace(o, rl, trONE);
                        else
                        if (is_clifford_tinfo(o.return_type_tinfo(), rl))
                                prod *= dirac_trace(o, rl, trONE);
                        else
@@ -448,18 +447,18 @@ ex dirac_trace(const ex & e, unsigned char rl, const ex & trONE)
                        num--;
                        int *iv = new int[num];
                        ex result;
                        num--;
                        int *iv = new int[num];
                        ex result;
-                       for (int i=0; i<num-3; i++) {
+                       for (unsigned i=0; i<num-3; i++) {
                                ex idx1 = ix[i];
                                ex idx1 = ix[i];
-                               for (int j=i+1; j<num-2; j++) {
+                               for (unsigned j=i+1; j<num-2; j++) {
                                        ex idx2 = ix[j];
                                        ex idx2 = ix[j];
-                                       for (int k=j+1; k<num-1; k++) {
+                                       for (unsigned k=j+1; k<num-1; k++) {
                                                ex idx3 = ix[k];
                                                ex idx3 = ix[k];
-                                               for (int l=k+1; l<num; l++) {
+                                               for (unsigned l=k+1; l<num; l++) {
                                                        ex idx4 = ix[l];
                                                        iv[0] = i; iv[1] = j; iv[2] = k; iv[3] = l;
                                                        exvector v;
                                                        v.reserve(num - 4);
                                                        ex idx4 = ix[l];
                                                        iv[0] = i; iv[1] = j; iv[2] = k; iv[3] = l;
                                                        exvector v;
                                                        v.reserve(num - 4);
-                                                       for (int n=0, t=4; n<num; n++) {
+                                                       for (unsigned n=0, t=4; n<num; n++) {
                                                                if (n == i || n == j || n == k || n == l)
                                                                        continue;
                                                                iv[t++] = n;
                                                                if (n == i || n == j || n == k || n == l)
                                                                        continue;
                                                                iv[t++] = n;
index 57364b5c500ca7a5dd8c77c4c31a77c732f07064..3b544171ac24b5e0030eb134bc0794c832d96526 100644 (file)
@@ -573,7 +573,7 @@ ex color_trace(const ex & e, unsigned char rl)
 
                        exvector v1;
                        v1.reserve(num - 2);
 
                        exvector v1;
                        v1.reserve(num - 2);
-                       for (int i=0; i<num-2; i++)
+                       for (unsigned i=0; i<num-2; i++)
                                v1.push_back(e.op(i));
 
                        exvector v2 = v1;
                                v1.push_back(e.op(i));
 
                        exvector v2 = v1;
index 736c109b656ec26eeb658e2c9ccd3b133a76b2e3..a603ca229e0250e652d00d0cbc6853d2feb6f6e9 100644 (file)
@@ -535,8 +535,8 @@ exvector power::get_free_indices(void) const
  *    by the function */
 static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, exvector & local_dummy_indices)
 {
  *    by the function */
 static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, exvector & local_dummy_indices)
 {
-       int global_size = global_dummy_indices.size(),
-           local_size = local_dummy_indices.size();
+       unsigned global_size = global_dummy_indices.size(),
+                local_size = local_dummy_indices.size();
 
        // Any local dummy indices at all?
        if (local_size == 0)
 
        // Any local dummy indices at all?
        if (local_size == 0)
@@ -596,7 +596,7 @@ ex simplify_indexed_product(const ex & e, exvector & free_indices, exvector & du
                v.push_back(e.op(0));
                v.push_back(e.op(0));
        } else {
                v.push_back(e.op(0));
                v.push_back(e.op(0));
        } else {
-               for (int i=0; i<e.nops(); i++) {
+               for (unsigned i=0; i<e.nops(); i++) {
                        ex f = e.op(i);
                        if (is_ex_exactly_of_type(f, power) && f.op(1).is_equal(_ex2())) {
                                v.push_back(f.op(0));
                        ex f = e.op(i);
                        if (is_ex_exactly_of_type(f, power) && f.op(1).is_equal(_ex2())) {
                                v.push_back(f.op(0));
@@ -604,7 +604,7 @@ ex simplify_indexed_product(const ex & e, exvector & free_indices, exvector & du
                        } else if (is_ex_exactly_of_type(f, ncmul)) {
                                // Noncommutative factor found, split it as well
                                non_commutative = true; // everything becomes noncommutative, ncmul will sort out the commutative factors later
                        } else if (is_ex_exactly_of_type(f, ncmul)) {
                                // Noncommutative factor found, split it as well
                                non_commutative = true; // everything becomes noncommutative, ncmul will sort out the commutative factors later
-                               for (int j=0; j<f.nops(); j++)
+                               for (unsigned j=0; j<f.nops(); j++)
                                        v.push_back(f.op(j));
                        } else
                                v.push_back(f);
                                        v.push_back(f.op(j));
                        } else
                                v.push_back(f);
index 46df9595bd16d0f7efd259fd08cc9bd4bea93b92..f39de456a20a312b32148e9d4aea7df221488c56 100644 (file)
@@ -171,7 +171,7 @@ void set_lexer_symbols(ex l)
        syms.clear();
        if (!is_ex_exactly_of_type(l, lst))
                return;
        syms.clear();
        if (!is_ex_exactly_of_type(l, lst))
                return;
-       for (int i=0; i<l.nops(); i++) {
+       for (unsigned i=0; i<l.nops(); i++) {
                if (is_ex_exactly_of_type(l.op(i), symbol))
                        syms[ex_to_symbol(l.op(i)).get_name()] = sym_def(l.op(i), true);
        }
                if (is_ex_exactly_of_type(l.op(i), symbol))
                        syms[ex_to_symbol(l.op(i)).get_name()] = sym_def(l.op(i), true);
        }
index 91382c2fd303612a1899a8f59c7d59b25b478880..1f5e9af50f939273a17727f6d7b78bd83682c233 100644 (file)
@@ -415,10 +415,8 @@ bool matrix::contract_with(exvector::iterator self, exvector::iterator other, ex
        const matrix &other_matrix = ex_to<matrix>(other->op(0));
 
        if (self->nops() == 2) {
        const matrix &other_matrix = ex_to<matrix>(other->op(0));
 
        if (self->nops() == 2) {
-               unsigned self_dim = (self_matrix.col == 1) ? self_matrix.row : self_matrix.col;
 
                if (other->nops() == 2) { // vector * vector (scalar product)
 
                if (other->nops() == 2) { // vector * vector (scalar product)
-                       unsigned other_dim = (other_matrix.col == 1) ? other_matrix.row : other_matrix.col;
 
                        if (self_matrix.col == 1) {
                                if (other_matrix.col == 1) {
 
                        if (self_matrix.col == 1) {
                                if (other_matrix.col == 1) {
index 8ee00c8fc4cf7363cd63d1bbf953f4b62a51fc26..379d1230b1b685808f4a331d2a6d6bb3e1cf1829 100644 (file)
@@ -1831,7 +1831,7 @@ ex sqrfree_parfrac(const ex & a, const symbol & x)
        // Factorize denominator and compute cofactors
        exvector yun = sqrfree_yun(denom, x);
 //clog << "yun factors: " << exprseq(yun) << endl;
        // Factorize denominator and compute cofactors
        exvector yun = sqrfree_yun(denom, x);
 //clog << "yun factors: " << exprseq(yun) << endl;
-       int num_yun = yun.size();
+       unsigned num_yun = yun.size();
        exvector factor; factor.reserve(num_yun);
        exvector cofac; cofac.reserve(num_yun);
        for (unsigned i=0; i<num_yun; i++) {
        exvector factor; factor.reserve(num_yun);
        exvector cofac; cofac.reserve(num_yun);
        for (unsigned i=0; i<num_yun; i++) {
@@ -1849,7 +1849,7 @@ ex sqrfree_parfrac(const ex & a, const symbol & x)
                        }
                }
        }
                        }
                }
        }
-       int num_factors = factor.size();
+       unsigned num_factors = factor.size();
 //clog << "factors  : " << exprseq(factor) << endl;
 //clog << "cofactors: " << exprseq(cofac) << endl;
 
 //clog << "factors  : " << exprseq(factor) << endl;
 //clog << "cofactors: " << exprseq(cofac) << endl;
 
@@ -1857,7 +1857,7 @@ ex sqrfree_parfrac(const ex & a, const symbol & x)
        int max_denom_deg = denom.degree(x);
        matrix sys(max_denom_deg + 1, num_factors);
        matrix rhs(max_denom_deg + 1, 1);
        int max_denom_deg = denom.degree(x);
        matrix sys(max_denom_deg + 1, num_factors);
        matrix rhs(max_denom_deg + 1, 1);
-       for (unsigned i=0; i<=max_denom_deg; i++) {
+       for (int i=0; i<=max_denom_deg; i++) {
                for (unsigned j=0; j<num_factors; j++)
                        sys(i, j) = cofac[j].coeff(x, i);
                rhs(i, 0) = red_numer.coeff(x, i);
                for (unsigned j=0; j<num_factors; j++)
                        sys(i, j) = cofac[j].coeff(x, i);
                rhs(i, 0) = red_numer.coeff(x, i);
index 7d56f6ab09453d3ec0ba1a2251194198177c1ffa..dc2546ff907f52a1222a23863177a66d48a922d7 100644 (file)
@@ -141,7 +141,6 @@ DEFAULT_UNARCHIVE(symmetry)
 int symmetry::compare_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_of_type(other, symmetry));
 int symmetry::compare_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_of_type(other, symmetry));
-       const symmetry &o = static_cast<const symmetry &>(other);
 
        // All symmetry trees are equal. They are not supposed to appear in
        // ordinary expressions anyway...
 
        // All symmetry trees are equal. They are not supposed to appear in
        // ordinary expressions anyway...
@@ -309,7 +308,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
 static ex symm(const ex & e, exvector::const_iterator first, exvector::const_iterator last, bool asymmetric)
 {
        // Need at least 2 objects for this operation
 static ex symm(const ex & e, exvector::const_iterator first, exvector::const_iterator last, bool asymmetric)
 {
        // Need at least 2 objects for this operation
-       int num = last - first;
+       unsigned num = last - first;
        if (num < 2)
                return e;
 
        if (num < 2)
                return e;
 
@@ -358,7 +357,7 @@ ex antisymmetrize(const ex & e, exvector::const_iterator first, exvector::const_
 ex symmetrize_cyclic(const ex & e, exvector::const_iterator first, exvector::const_iterator last)
 {
        // Need at least 2 objects for this operation
 ex symmetrize_cyclic(const ex & e, exvector::const_iterator first, exvector::const_iterator last)
 {
        // Need at least 2 objects for this operation
-       int num = last - first;
+       unsigned num = last - first;
        if (num < 2)
                return e;
 
        if (num < 2)
                return e;
 
index 00d0cdff12da38478cd6ccc5fa8502270d145640..1c8847a41b1f5dede2b29e2e61919369e6baa52f 100644 (file)
@@ -344,7 +344,7 @@ bool tensdelta::contract_with(exvector::iterator self, exvector::iterator other,
 
 again:
        if (self_idx->is_symbolic()) {
 
 again:
        if (self_idx->is_symbolic()) {
-               for (int i=1; i<other->nops(); i++) {
+               for (unsigned i=1; i<other->nops(); i++) {
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
@@ -389,7 +389,7 @@ bool tensmetric::contract_with(exvector::iterator self, exvector::iterator other
 
 again:
        if (self_idx->is_symbolic()) {
 
 again:
        if (self_idx->is_symbolic()) {
-               for (int i=1; i<other->nops(); i++) {
+               for (unsigned i=1; i<other->nops(); i++) {
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
@@ -467,7 +467,7 @@ bool spinmetric::contract_with(exvector::iterator self, exvector::iterator other
 
 again:
        if (self_idx->is_symbolic()) {
 
 again:
        if (self_idx->is_symbolic()) {
-               for (int i=1; i<other->nops(); i++) {
+               for (unsigned i=1; i<other->nops(); i++) {
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
                        const idx &other_idx = ex_to<idx>(other->op(i));
                        if (is_dummy_pair(*self_idx, other_idx)) {
 
index 16601cee15d2e6792ec74446bcc37f77a5a6e070..bca29dd53a28a54d797e3a33bfd663a75cc72c72 100644 (file)
@@ -398,6 +398,7 @@ class apply_map_function : public map_function {
        ex apply;
 public:
        apply_map_function(const ex & a) : apply(a) {}
        ex apply;
 public:
        apply_map_function(const ex & a) : apply(a) {}
+       virtual ~apply_map_function() {}
        ex operator()(const ex & e) { return apply.subs(wild() == e, true); }
 };
 
        ex operator()(const ex & e) { return apply.subs(wild() == e, true); }
 };