This patch fixes a bug on machines where char is unsigned by default, by extending the type of clifford_max_label to include all 257 possible return values. --- ginac-1.4.3.orig/ginac/add.cpp 2008-03-27 10:16:10.000000000 +0000 +++ ginac-1.4.3/ginac/add.cpp 2008-05-03 10:59:02.000000000 +0100 @@ -291,7 +291,7 @@ { std::auto_ptr coeffseq(new epvector); std::auto_ptr coeffseq_cliff(new epvector); - char rl = clifford_max_label(s); + int rl = clifford_max_label(s); bool do_clifford = (rl != -1); bool nonscalar = false; --- ginac-1.4.3.orig/ginac/clifford.cpp 2008-03-27 10:16:10.000000000 +0000 +++ ginac-1.4.3/ginac/clifford.cpp 2008-05-03 10:58:24.000000000 +0100 @@ -1126,7 +1126,7 @@ return e1; } -char clifford_max_label(const ex & e, bool ignore_ONE) +int clifford_max_label(const ex & e, bool ignore_ONE) { if (is_a(e)) if (ignore_ONE && is_a(e.op(0))) @@ -1134,7 +1134,7 @@ else return ex_to(e).get_representation_label(); else { - char rl = -1; + int rl = -1; for (size_t i=0; i < e.nops(); i++) rl = (rl > clifford_max_label(e.op(i), ignore_ONE)) ? rl : clifford_max_label(e.op(i), ignore_ONE); return rl; --- ginac-1.4.3.orig/ginac/clifford.h 2008-03-27 10:16:10.000000000 +0000 +++ ginac-1.4.3/ginac/clifford.h 2008-05-03 11:04:08.000000000 +0100 @@ -299,7 +299,7 @@ * * @param e Expression to be processed * @ignore_ONE defines if clifford_ONE should be ignored in the search*/ -char clifford_max_label(const ex & e, bool ignore_ONE = false); +int clifford_max_label(const ex & e, bool ignore_ONE = false); /** Calculation of the norm in the Clifford algebra. */ ex clifford_norm(const ex & e);