Description: Fix some mixed signed/unsigned operations.
Origin: https://src.fedoraproject.org/rpms/qepcad-B/blob/60ceecd/f/qepcad-B-signed.patch
Forwarded: https://github.com/chriswestbrown/qepcad/pull/2
Last-Update: 2021-06-23

--- a/plot2d/plot.cc
+++ b/plot2d/plot.cc
@@ -134,7 +134,7 @@
 	pthread_mutex_lock(&M);
 	swap(CE,E);
 	pthread_mutex_unlock(&M);
-	for(int i = 0; i < E.size(); i++) delete E[i];
+	for(size_t i = 0; i < E.size(); i++) delete E[i];
 	E.clear(); }
       else if (c == 'E') { /******* Exit! *******************/
 	return 0;
@@ -155,7 +155,7 @@
 {
   pthread_mutex_lock(&M);
   glClear(GL_COLOR_BUFFER_BIT);
-  for(int i = 0; i < CE.size(); i++)
+  for(size_t i = 0; i < CE.size(); i++)
     CE[i]->glRend(Colors);
   pthread_mutex_unlock(&M);  
   glutSwapBuffers();
@@ -286,7 +286,7 @@
   // 128 or so points that can appear.
   C.glSetColor(colorType,'D');
   glBegin(GL_LINE_STRIP);
-  for(int i = 0; i < V.size(); i++)
+  for(size_t i = 0; i < V.size(); i++)
     glVertex2(V[i]);
   glEnd();
 }
@@ -328,7 +328,7 @@
     else 
     {
       cerr << "Sector over sector in unknown format!" << endl;
-      for(int i = 0; i < V.size(); i++)
+      for(size_t i = 0; i < V.size(); i++)
 	cerr << V[i] << endl;
       exit(1);
     }
--- a/source/db/SINGULAR.c
+++ b/source/db/SINGULAR.c
@@ -67,7 +67,7 @@
   Word A, t;
   string s;
   in >> s;
-  for(int i = 0; i < s.length(); ++i)
+  for(size_t i = 0; i < s.length(); ++i)
     if (s[i] == '*') s[i] = ' ';
   s += ".\n";
   istringstream si(s);
@@ -108,7 +108,7 @@
     out = sout.str();
   }
   // Put in * symbols
-  for(int i = 1; i < out.length() - 1; ++i)
+  for(size_t i = 1; i < out.length() - 1U; ++i)
     if (out[i] == ' ' && out[i+1] != '+' && out[i+1] != '-'
 	&& out[i-1] != '+' && out[i-1] != '-'
 	)
--- a/source/main/qepcadcls.c
+++ b/source/main/qepcadcls.c
@@ -60,7 +60,7 @@
 
 void QepcadCls::UnsatCore::OrigAtom::clearTags()
 {
-  for(int i = 0; i < factors.size(); i++)
+  for(size_t i = 0; i < factors.size(); i++)
     factors[i].clearTag();
 }
 
@@ -82,7 +82,7 @@
   }
 
   // set in factored form
-  for(int k = 0; k < conjuncts.size(); k++)
+  for(int k = 0; (size_t)k < conjuncts.size(); k++)
   {
     OrigAtom &A = conjuncts[k];
     Word r = A.r;
@@ -205,7 +205,7 @@
   {
     if (sign < 0) SWRITE("-");
     if (ICOMP(content,1) != 0) { IWRITE(content); }
-    for(int i = 0; i < factors.size(); i++)
+    for(size_t i = 0; i < factors.size(); i++)
       factors[i].WRITEFULL(V);
     SWRITE(" ");
     SWRITE(relopString(relop).c_str());
@@ -218,7 +218,7 @@
 bool QepcadCls::UnsatCore::OrigAtom::isKnownFalse()
 {
   int s = signToSigma(sign);
-  for(int i = 0; i < factors.size(); i++)
+  for(size_t i = 0; i < factors.size(); i++)
   {    
     int sf = (factors[i].exp % 2 == 1) ? factors[i].tag : T_square[factors[i].tag];
     s = T_prod[s][sf];
@@ -235,7 +235,7 @@
   if (LELTI(C,HOWTV) == BYEQC) return;
 
   // Clear truth tags (i.e. set them all to UNDET)
-  for(int i = 0; i < conjuncts.size(); i++)
+  for(size_t i = 0; i < conjuncts.size(); i++)
     conjuncts[i].clearTags();
   
   int k = LELTI(C,LEVEL);
@@ -252,7 +252,7 @@
     {
       int s = FIRST(Si);
       vector< pair<int,int> > &V = appearsIn[pair<int,int>(i,j)];
-      for(int h = 0; h < V.size(); h++)
+      for(size_t h = 0; h < V.size(); h++)
       {
 	int a = V[h].first, b = V[h].second;
 	conjuncts[a].factors[b].tag = signToSigma(s);
@@ -262,7 +262,7 @@
 
   // go through each input atomic formula to determine if it's known to be false
   Word K = NIL;
-  for(int i = 0; i < conjuncts.size(); i++)
+  for(int i = 0; (size_t)i < conjuncts.size(); i++)
   {
     if (conjuncts[i].isKnownFalse())
     {
@@ -280,7 +280,7 @@
     // Add equational constraints as size 1 sets.  Recall, right now
     // we adopt the expedient of making the unsat core include all
     // equational constraints.
-    for(int i = 0; i < conjuncts.size(); i++)
+    for(int i = 0; (size_t)i < conjuncts.size(); i++)
     {
       if (conjuncts[i].relop == EQOP)
 	MHSP = COMP(LIST1(i),MHSP);
--- a/source/saclib/gcword.c
+++ b/source/saclib/gcword.c
@@ -54,7 +54,7 @@
 void gcw_register(Word *p)
 {
   G.push_back(p);
-  if (G.size() == lim)
+  if (G.size() == (size_t)lim)
     clean();
 }
 
@@ -62,7 +62,7 @@
 {
   //  SWRITE("gcw size is: ");IWRITE(G.size()); SWRITE("\n");
   clean();
-  for(int i = 0; i < G.size(); i++)
+  for(size_t i = 0; i < G.size(); i++)
     if (*G[i] > BETA && *G[i] < BETAp && (*G[i] & 1))
       MARK(*G[i]);
 
