* Fix compilation issues with prereleases of GCC 4.3, at least in theory.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 2 Apr 2007 06:16:16 +0000 (06:16 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 2 Apr 2007 06:16:16 +0000 (06:16 +0000)
  See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417199>.

ginac/add.cpp
ginac/function.pl
ginac/indexed.cpp
ginac/integral.cpp
ginac/pseries.cpp
ginac/symmetry.cpp
ginac/symmetry.h

index 353b4a7744079ec1d73549454746a5a36eaf632f..b37ab79def6926ca36c3dc804f068580c10b7b09 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <iostream>
 #include <stdexcept>
+#include <limits>
 
 #include "add.h"
 #include "mul.h"
@@ -258,7 +259,7 @@ bool add::info(unsigned inf) const
 
 int add::degree(const ex & s) const
 {
-       int deg = INT_MIN;
+       int deg = std::numeric_limits<int>::min();
        if (!overall_coeff.is_zero())
                deg = 0;
        
@@ -275,7 +276,7 @@ int add::degree(const ex & s) const
 
 int add::ldegree(const ex & s) const
 {
-       int deg = INT_MAX;
+       int deg = std::numeric_limits<int>::max();
        if (!overall_coeff.is_zero())
                deg = 0;
        
index 4f8e35378fb4e3031d88ec3972c2a213fd933435..da8953c3fc29f6e7728bc67728d13192e6b41569 100755 (executable)
@@ -593,6 +593,7 @@ $implementation=<<END_OF_IMPLEMENTATION;
 #include <string>
 #include <stdexcept>
 #include <list>
+#include <limits>
 
 #include "function.h"
 #include "operators.h"
@@ -983,7 +984,7 @@ ex function::eval(int level) const
                exvector v = seq;
                GINAC_ASSERT(is_a<symmetry>(opt.symtree));
                int sig = canonicalize(v.begin(), ex_to<symmetry>(opt.symtree));
-               if (sig != INT_MAX) {
+               if (sig != std::numeric_limits<int>::max()) {
                        // Something has changed while sorting arguments, more evaluations later
                        if (sig == 0)
                                return _ex0;
index f7172efc7ec3644d14afb4dfb9b46ed277edb3be..b3c18ba51989ba37bdebb03b111f007858721ec1 100644 (file)
@@ -23,6 +23,7 @@
 #include <iostream>
 #include <sstream>
 #include <stdexcept>
+#include <limits>
 
 #include "indexed.h"
 #include "idx.h"
@@ -306,7 +307,7 @@ ex indexed::eval(int level) const
                exvector v = seq;
                GINAC_ASSERT(is_exactly_a<symmetry>(symtree));
                int sig = canonicalize(v.begin() + 1, ex_to<symmetry>(symtree));
-               if (sig != INT_MAX) {
+               if (sig != std::numeric_limits<int>::max()) {
                        // Something has changed while sorting indices, more evaluations later
                        if (sig == 0)
                                return _ex0;
index f9d42a99520d4761ff51a0795873ed69a87aa692..57f3532bc5ffea8991e01357a2a0587571c82bfb 100644 (file)
@@ -223,7 +223,7 @@ struct error_and_integral
 
 struct error_and_integral_is_less
 {
-       bool operator()(const error_and_integral &e1,const error_and_integral &e2)
+       bool operator()(const error_and_integral &e1,const error_and_integral &e2) const
        {
                int c = e1.integral.compare(e2.integral);
                if(c < 0)
index 1e61e0aee18b8066eea85bf1360572a3b3d86074..ec8e8c652560bb60eceadc99dbf44b3e1aedd4f5 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <numeric>
 #include <stdexcept>
+#include <limits>
 
 #include "pseries.h"
 #include "add.h"
@@ -292,7 +293,7 @@ int pseries::degree(const ex &s) const
                epvector::const_iterator it = seq.begin(), itend = seq.end();
                if (it == itend)
                        return 0;
-               int max_pow = INT_MIN;
+               int max_pow = std::numeric_limits<int>::min();
                while (it != itend) {
                        int pow = it->rest.degree(s);
                        if (pow > max_pow)
@@ -320,7 +321,7 @@ int pseries::ldegree(const ex &s) const
                epvector::const_iterator it = seq.begin(), itend = seq.end();
                if (it == itend)
                        return 0;
-               int min_pow = INT_MAX;
+               int min_pow = std::numeric_limits<int>::max();
                while (it != itend) {
                        int pow = it->rest.ldegree(s);
                        if (pow < min_pow)
@@ -718,7 +719,7 @@ ex pseries::add_series(const pseries &other) const
        epvector::const_iterator b = other.seq.begin();
        epvector::const_iterator a_end = seq.end();
        epvector::const_iterator b_end = other.seq.end();
-       int pow_a = INT_MAX, pow_b = INT_MAX;
+       int pow_a = std::numeric_limits<int>::max(), pow_b = std::numeric_limits<int>::max();
        for (;;) {
                // If a is empty, fill up with elements from b and stop
                if (a == a_end) {
@@ -851,8 +852,8 @@ ex pseries::mul_series(const pseries &other) const
        int cdeg_min = a_min + b_min;
        int cdeg_max = a_max + b_max;
        
-       int higher_order_a = INT_MAX;
-       int higher_order_b = INT_MAX;
+       int higher_order_a = std::numeric_limits<int>::max();
+       int higher_order_b = std::numeric_limits<int>::max();
        if (is_order_function(coeff(var, a_max)))
                higher_order_a = a_max + b_min;
        if (is_order_function(other.coeff(var, b_max)))
@@ -873,7 +874,7 @@ ex pseries::mul_series(const pseries &other) const
                if (!co.is_zero())
                        new_seq.push_back(expair(co, numeric(cdeg)));
        }
-       if (higher_order_c < INT_MAX)
+       if (higher_order_c < std::numeric_limits<int>::max())
                new_seq.push_back(expair(Order(_ex1), numeric(higher_order_c)));
        return pseries(relational(var, point), new_seq);
 }
index 123346bff0bf08e26f033b3105a301f08b4a4a20..6ab0944dd79882d7dd4284a800f4fdf45a9fb06c 100644 (file)
@@ -23,6 +23,7 @@
 #include <iostream>
 #include <stdexcept>
 #include <functional>
+#include <limits>
 
 #include "symmetry.h"
 #include "lst.h"
@@ -431,7 +432,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
 {
        // Less than two elements? Then do nothing
        if (symm.indices.size() < 2)
-               return INT_MAX;
+               return std::numeric_limits<int>::max();
 
        // Canonicalize children first
        bool something_changed = false;
@@ -442,7 +443,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
                int child_sign = canonicalize(v, ex_to<symmetry>(*first));
                if (child_sign == 0)
                        return 0;
-               if (child_sign != INT_MAX) {
+               if (child_sign != std::numeric_limits<int>::max()) {
                        something_changed = true;
                        sign *= child_sign;
                }
@@ -469,7 +470,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
                default:
                        break;
        }
-       return something_changed ? sign : INT_MAX;
+       return something_changed ? sign : std::numeric_limits<int>::max();
 }
 
 
index bb6af2dfb6fa23d262453c2199ab87ebe4387b51..9282b75e2f2616941645f25278118068ee1524eb 100644 (file)
@@ -139,7 +139,7 @@ const symmetry & antisymmetric4();
  *  @param v Start of expression vector
  *  @param symm Root node of symmetry tree
  *  @return the overall sign introduced by the reordering (+1, -1 or 0)
- *          or INT_MAX if nothing changed */
+ *          or numeric_limits<int>::max() if nothing changed */
 extern int canonicalize(exvector::iterator v, const symmetry &symm);
 
 /** Symmetrize expression over a set of objects (symbols, indices). */