[gfan] Update the -warning patch to eliminate a double declaration of the variable i in one scope. GCC 4.7

Jerry James jjames at fedoraproject.org
Mon Jan 9 18:37:06 UTC 2012


commit 882536f289015f781155dec0c9048e1b8b9390cf
Author: Jerry James <loganjerry at gmail.com>
Date:   Mon Jan 9 11:36:40 2012 -0700

    Update the -warning patch to eliminate a double declaration of the variable
    i in one scope.  GCC 4.7 treats that as an error.

 gfan-warning.patch |  317 +++++++++++++++++++++++++++-------------------------
 1 files changed, 164 insertions(+), 153 deletions(-)
---
diff --git a/gfan-warning.patch b/gfan-warning.patch
index e228a9c..066ab65 100644
--- a/gfan-warning.patch
+++ b/gfan-warning.patch
@@ -1,95 +1,16 @@
---- ./app_fancoarsening.cpp.orig	2011-01-25 08:33:15.000000000 -0700
-+++ ./app_fancoarsening.cpp	2011-04-27 14:49:26.185117544 -0600
-@@ -33,12 +33,14 @@
-     return false;
-   }
- 
-+#if 0
-   IntegerVectorList inequalitiesForCone(IntegerVector const &codim1interior, IntegerVector const &newDirection)
-   {
- 
-     int i=0;
- 
-   }
-+#endif
- 
-   const char *helpText()
-   {
---- ./field_rationals.cpp.orig	2011-01-25 08:33:16.000000000 -0700
-+++ ./field_rationals.cpp	2011-04-27 14:49:26.186117482 -0600
-@@ -326,17 +326,17 @@
-   return "GmpRationals";
- }
- 
--/*FieldRationals::FieldRationals():
-+#if 0
-+FieldRationals::FieldRationals():
-   Field(new FieldRationalsImplementation())
- {
-   /*  fprintf(Stderr,"Adding field rationals\n");
-   next=list;
-   list=this;
-   */
--/*
-   log2 fprintf(Stderr,"Initializing field Rationals\n");
- }
--*/
-+#endif
- 				//FieldRationals Q;
- Field Q(new FieldRationalsImplementation());
- 
---- ./wallideal.cpp.orig	2011-01-25 08:33:17.000000000 -0700
-+++ ./wallideal.cpp	2011-04-27 14:49:26.188117356 -0600
-@@ -928,7 +928,7 @@
-   return isFacet(normals,i);
- }
- */
-- /*
-+#if 0 
- bool fastIsFacet(IntegerVectorList const &normals, IntegerVectorList::const_iterator i)
- {
-   int n=i->size();
-@@ -963,7 +963,7 @@
- 	    }
- 	}
-       */
--/*    int bestEntry=-1;
-+      int bestEntry=-1;
-       int bestCount=2000000000;
-       int bestValue=0;
-       for(int j=0;j<n;j++)
-@@ -1029,7 +1029,7 @@
-   //  log0 fprintf(Stderr,"LP\n");
-   return isFacet(normals,i);
- }
--*/
-+#endif
- 
- IntegerVectorList fastNormals(IntegerVectorList const &inequalities)
- {
---- ./vektor.cpp.orig	2011-01-25 08:33:17.000000000 -0700
-+++ ./vektor.cpp	2011-04-27 14:49:26.189117295 -0600
-@@ -96,7 +96,7 @@
- int gcdOfVector(IntegerVector const &v)
- {
-   int ret=0;
--  for(int i=0;i<v.size();i++)if(ret=v[i])break;
-+  for(int i=0;i<v.size();i++)if((ret=v[i]))break;
-   if(ret<0)ret=-ret;
-   assert(ret!=0);
-   for(int i=0;i<v.size();i++)ret=gcdGFAN(ret,v[i]);
---- ./app_tropicalintersection.cpp.orig	2011-01-25 08:33:15.000000000 -0700
-+++ ./app_tropicalintersection.cpp	2011-04-27 14:49:26.190117235 -0600
-@@ -42,6 +42,7 @@
- 			AsciiPrinter(Stdout)<<"The following vector is in intersection, but initial ideal contains a monomial:\n"<<w;
- 			assert(0);
- 		}
-+		return true;
- 	}
- };
- 
---- ./app_test.cpp.orig	2011-04-27 14:49:21.163424639 -0600
-+++ ./app_test.cpp	2011-04-27 14:49:26.191117174 -0600
+--- ./app_minkowski.cpp.orig	2011-01-25 08:33:15.000000000 -0700
++++ ./app_minkowski.cpp	2012-01-09 11:28:20.926240318 -0700
+@@ -160,7 +160,7 @@ public:
+ 	    //log0 fprintf(Stderr,"4");
+ 	    f.insert(c);
+ 	    //log0 fprintf(Stderr,"5\n");
+-	    static int i;
++	    //static int i;
+ 	    //log0 fprintf(Stderr,"inserted:%i\n",++i);
+ 	  }
+ 	log1 fprintf(Stderr,"Resolving symmetries.\n");
+--- ./app_test.cpp.orig	2011-01-25 08:33:15.000000000 -0700
++++ ./app_test.cpp	2012-01-09 11:27:29.305437764 -0700
 @@ -1,5 +1,7 @@
  #include <iostream>
  #include <stdlib.h>
@@ -98,7 +19,7 @@
  #include "parser.h"
  #include "printer.h"
  #include "polynomial.h"
-@@ -193,10 +195,7 @@
+@@ -193,10 +195,7 @@ public:
  		  {
  			  outputName=outputName+"New";
  		  }
@@ -110,7 +31,7 @@
  		  string command3="cat <"+input+"|"+string(command2)+">"+outputName;
  		  cerr<<"Running command:\""<<command3<<"\""<<endl;
  		  system(command3.c_str());
-@@ -207,22 +206,17 @@
+@@ -207,22 +206,17 @@ public:
  
    list<string> subFolderNames()
    {
@@ -141,20 +62,9 @@
  	  return ret;
    }
  
---- ./gfanlib_polymakefile.cpp.orig	2011-01-25 08:33:16.000000000 -0700
-+++ ./gfanlib_polymakefile.cpp	2011-04-27 14:50:10.599401328 -0600
-@@ -51,7 +51,7 @@
- {
-   list<int> ret;
-   int c=s.peek();
--  while((c>='0') && (c<='9')|| (c==' '))
-+  while((c>='0' && c<='9')|| c==' ')
-     {
-       //      fprintf(Stderr,"?\n");
-       int r;
 --- ./gfanlib_vector.h.orig	2011-01-25 08:33:18.000000000 -0700
-+++ ./gfanlib_vector.h	2011-04-27 14:49:26.193117051 -0600
-@@ -288,6 +288,7 @@
++++ ./gfanlib_vector.h	2012-01-09 11:27:29.307437580 -0700
+@@ -288,6 +288,7 @@ public:
            f<<*i;
          }
          f<<")";
@@ -162,30 +72,80 @@
        }
    typ gcd()const
    {
---- ./gfanlib_zcone.cpp.orig	2011-01-25 08:33:16.000000000 -0700
-+++ ./gfanlib_zcone.cpp	2011-04-27 14:49:26.196116868 -0600
-@@ -726,6 +726,7 @@
-   f<<c.inequalities<<std::endl;
-   f<<"Equations:"<<std::endl;
-   f<<c.equations<<std::endl;
-+  return f;
+--- ./app_tropicalintersection.cpp.orig	2011-01-25 08:33:15.000000000 -0700
++++ ./app_tropicalintersection.cpp	2012-01-09 11:27:29.304437850 -0700
+@@ -42,6 +42,7 @@ public:
+ 			AsciiPrinter(Stdout)<<"The following vector is in intersection, but initial ideal contains a monomial:\n"<<w;
+ 			assert(0);
+ 		}
++		return true;
+ 	}
+ };
+ 
+--- ./application.cpp.orig	2011-01-25 08:33:16.000000000 -0700
++++ ./application.cpp	2012-01-09 11:27:29.312437096 -0700
+@@ -3,6 +3,8 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <limits.h>
++#include <unistd.h>
+ #include <string>
+ #include <list>
+ 
+@@ -546,10 +548,11 @@ void Application::makeSymbolicLinks(cons
+       if(all || p->includeInDefaultInstallation())
+ 	if(strlen(p->name())>0)
+ 	  {
+-	    char c[1024];
+-	    sprintf(c,"ln -s %s%s %s%s%s\n",path,name,path,name,p->name());
+-	    fprintf(stderr,"%s",c);
+-	    system(c);
++	    char c[PATH_MAX], d[PATH_MAX];
++	    snprintf(c,PATH_MAX,"%s%s",path,name);
++	    snprintf(d,PATH_MAX,"%s%s%s",path,name,p->name());
++	    fprintf(stderr,"ln -s %s %s\n",c,d);
++	    symlink(c,d);
+ 	  }
+       p=p->next;
+     }
+--- ./field_rationals.cpp.orig	2011-01-25 08:33:16.000000000 -0700
++++ ./field_rationals.cpp	2012-01-09 11:27:29.300438251 -0700
+@@ -326,17 +326,17 @@ const char *FieldRationalsImplementation
+   return "GmpRationals";
  }
  
+-/*FieldRationals::FieldRationals():
++#if 0
++FieldRationals::FieldRationals():
+   Field(new FieldRationalsImplementation())
+ {
+   /*  fprintf(Stderr,"Adding field rationals\n");
+   next=list;
+   list=this;
+   */
+-/*
+   log2 fprintf(Stderr,"Initializing field Rationals\n");
+ }
+-*/
++#endif
+ 				//FieldRationals Q;
+ Field Q(new FieldRationalsImplementation());
  
---- ./polymakefile.cpp.orig	2011-01-25 08:33:17.000000000 -0700
-+++ ./polymakefile.cpp	2011-04-27 14:49:26.197116807 -0600
-@@ -371,7 +371,7 @@
+--- ./vektor.cpp.orig	2011-01-25 08:33:17.000000000 -0700
++++ ./vektor.cpp	2012-01-09 11:27:29.303437946 -0700
+@@ -96,7 +96,7 @@ int gcdGFAN(int r, int s)
+ int gcdOfVector(IntegerVector const &v)
  {
-   list<int> ret;
-   int c=s.peek();
--  while((c>='0') && (c<='9')|| (c==' '))
-+  while((c>='0' && c<='9')|| c==' ')
-     {
-       //      fprintf(Stderr,"?\n");
-       int r;
+   int ret=0;
+-  for(int i=0;i<v.size();i++)if(ret=v[i])break;
++  for(int i=0;i<v.size();i++)if((ret=v[i]))break;
+   if(ret<0)ret=-ret;
+   assert(ret!=0);
+   for(int i=0;i<v.size();i++)ret=gcdGFAN(ret,v[i]);
 --- ./gfanlib_symmetriccomplex.cpp.orig	2011-01-25 08:33:16.000000000 -0700
-+++ ./gfanlib_symmetriccomplex.cpp	2011-04-27 14:49:26.199116684 -0600
-@@ -215,13 +215,12 @@
++++ ./gfanlib_symmetriccomplex.cpp	2012-01-09 11:27:29.311437193 -0700
+@@ -215,13 +215,12 @@ bool SymmetricComplex::isMaximal(Cone co
    return true;
  }
  
@@ -200,7 +160,7 @@
    IntVector ret(cones.size());
  
    int I=0;
-@@ -240,7 +239,7 @@
+@@ -240,7 +239,7 @@ IntVector SymmetricComplex::dimensionsAt
      }
    return ret;
  }
@@ -209,30 +169,81 @@
  
  void SymmetricComplex::buildConeLists(bool onlyMaximal, bool compressed, std::vector<std::vector<IntVector > >*conelist/*, ZMatrix *multiplicities*/)const
  {
---- ./application.cpp.orig	2011-01-25 08:33:16.000000000 -0700
-+++ ./application.cpp	2011-04-27 14:49:26.200116623 -0600
-@@ -3,6 +3,8 @@
- #include <assert.h>
- #include <stdlib.h>
- #include <stdio.h>
-+#include <limits.h>
-+#include <unistd.h>
- #include <string>
- #include <list>
+--- ./polymakefile.cpp.orig	2011-01-25 08:33:17.000000000 -0700
++++ ./polymakefile.cpp	2012-01-09 11:27:29.310437290 -0700
+@@ -371,7 +371,7 @@ static list<int> readIntList(istream &s)
+ {
+   list<int> ret;
+   int c=s.peek();
+-  while((c>='0') && (c<='9')|| (c==' '))
++  while((c>='0' && c<='9')|| c==' ')
+     {
+       //      fprintf(Stderr,"?\n");
+       int r;
+--- ./app_fancoarsening.cpp.orig	2011-01-25 08:33:15.000000000 -0700
++++ ./app_fancoarsening.cpp	2012-01-09 11:27:29.299438352 -0700
+@@ -33,12 +33,14 @@ public:
+     return false;
+   }
  
-@@ -546,10 +548,11 @@
-       if(all || p->includeInDefaultInstallation())
- 	if(strlen(p->name())>0)
- 	  {
--	    char c[1024];
--	    sprintf(c,"ln -s %s%s %s%s%s\n",path,name,path,name,p->name());
--	    fprintf(stderr,"%s",c);
--	    system(c);
-+	    char c[PATH_MAX], d[PATH_MAX];
-+	    snprintf(c,PATH_MAX,"%s%s",path,name);
-+	    snprintf(d,PATH_MAX,"%s%s%s",path,name,p->name());
-+	    fprintf(stderr,"ln -s %s %s\n",c,d);
-+	    symlink(c,d);
- 	  }
-       p=p->next;
-     }
++#if 0
+   IntegerVectorList inequalitiesForCone(IntegerVector const &codim1interior, IntegerVector const &newDirection)
+   {
+ 
+     int i=0;
+ 
+   }
++#endif
+ 
+   const char *helpText()
+   {
+--- ./gfanlib_polymakefile.cpp.orig	2011-01-25 08:33:16.000000000 -0700
++++ ./gfanlib_polymakefile.cpp	2012-01-09 11:27:29.306437673 -0700
+@@ -51,7 +51,7 @@ static list<int> readIntList(istream &s)
+ {
+   list<int> ret;
+   int c=s.peek();
+-  while((c>='0') && (c<='9')|| (c==' '))
++  while((c>='0' && c<='9')|| c==' ')
+     {
+       //      fprintf(Stderr,"?\n");
+       int r;
+--- ./gfanlib_zcone.cpp.orig	2011-01-25 08:33:16.000000000 -0700
++++ ./gfanlib_zcone.cpp	2012-01-09 11:27:29.309437387 -0700
+@@ -726,6 +726,7 @@ std::ostream &operator<<(std::ostream &f
+   f<<c.inequalities<<std::endl;
+   f<<"Equations:"<<std::endl;
+   f<<c.equations<<std::endl;
++  return f;
+ }
+ 
+ 
+--- ./wallideal.cpp.orig	2011-01-25 08:33:17.000000000 -0700
++++ ./wallideal.cpp	2012-01-09 11:27:29.301438150 -0700
+@@ -928,7 +928,7 @@ bool fastIsFacet(IntegerVectorList const
+   return isFacet(normals,i);
+ }
+ */
+- /*
++#if 0 
+ bool fastIsFacet(IntegerVectorList const &normals, IntegerVectorList::const_iterator i)
+ {
+   int n=i->size();
+@@ -963,7 +963,7 @@ bool fastIsFacet(IntegerVectorList const
+ 	    }
+ 	}
+       */
+-/*    int bestEntry=-1;
++      int bestEntry=-1;
+       int bestCount=2000000000;
+       int bestValue=0;
+       for(int j=0;j<n;j++)
+@@ -1029,7 +1029,7 @@ bool fastIsFacet(IntegerVectorList const
+   //  log0 fprintf(Stderr,"LP\n");
+   return isFacet(normals,i);
+ }
+-*/
++#endif
+ 
+ IntegerVectorList fastNormals(IntegerVectorList const &inequalities)
+ {


More information about the scm-commits mailing list