From 4f18eb00180c256681072f10d9e2e08dbf84ff0b Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Mon, 25 Jun 2001 22:32:26 +0000 Subject: [PATCH] fixed some -Wall stuff --- ginac/clifford.cpp | 15 +++++++-------- ginac/color.cpp | 2 +- ginac/indexed.cpp | 8 ++++---- ginac/input_lexer.ll | 2 +- ginac/matrix.cpp | 2 -- ginac/normal.cpp | 6 +++--- ginac/symmetry.cpp | 5 ++--- ginac/tensor.cpp | 6 +++--- ginsh/ginsh_parser.yy | 1 + 9 files changed, 22 insertions(+), 25 deletions(-) diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 80d7d342..cde94ebd 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -378,8 +378,8 @@ static ex trace_string(exvector::const_iterator ix, unsigned num) exvector v(num - 2); int sign = 1; ex result; - for (int i=1; i(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) - unsigned other_dim = (other_matrix.col == 1) ? other_matrix.row : other_matrix.col; if (self_matrix.col == 1) { if (other_matrix.col == 1) { diff --git a/ginac/normal.cpp b/ginac/normal.cpp index 8ee00c8f..379d1230 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -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; - 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(other); // 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 - int num = last - first; + unsigned num = last - first; 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 - int num = last - first; + unsigned num = last - first; if (num < 2) return e; diff --git a/ginac/tensor.cpp b/ginac/tensor.cpp index 00d0cdff..1c8847a4 100644 --- a/ginac/tensor.cpp +++ b/ginac/tensor.cpp @@ -344,7 +344,7 @@ bool tensdelta::contract_with(exvector::iterator self, exvector::iterator other, again: if (self_idx->is_symbolic()) { - for (int i=1; inops(); i++) { + for (unsigned i=1; inops(); i++) { const idx &other_idx = ex_to(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()) { - for (int i=1; inops(); i++) { + for (unsigned i=1; inops(); i++) { const idx &other_idx = ex_to(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()) { - for (int i=1; inops(); i++) { + for (unsigned i=1; inops(); i++) { const idx &other_idx = ex_to(other->op(i)); if (is_dummy_pair(*self_idx, other_idx)) { diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index 16601cee..bca29dd5 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -398,6 +398,7 @@ class apply_map_function : public map_function { 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); } }; -- 2.44.0