public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-lang/maude/files: maude-2.3.0-gcc43.patch
@ 2009-02-10  5:01 Ryan Hill (dirtyepic)
  0 siblings, 0 replies; only message in thread
From: Ryan Hill (dirtyepic) @ 2009-02-10  5:01 UTC (permalink / raw
  To: gentoo-commits

dirtyepic    09/02/10 05:01:37

  Added:                maude-2.3.0-gcc43.patch
  Log:
  Fix building with GCC 4.3 for bug #227529
  (Portage version: 2.2_rc23/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-lang/maude/files/maude-2.3.0-gcc43.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/maude/files/maude-2.3.0-gcc43.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/maude/files/maude-2.3.0-gcc43.patch?rev=1.1&content-type=text/plain

Index: maude-2.3.0-gcc43.patch
===================================================================
--- Maude-2.3/src/BuiltIn/stringOpSymbol.cc	2003-11-10 18:33:00.000000000 -0600
+++ Maude-2.4/src/BuiltIn/stringOpSymbol.cc	2008-09-11 19:03:36.000000000 -0600
@@ -220,7 +220,9 @@ StringOpSymbol::eqRewrite(DagNode* subje
 	      case CODE('f', 'l'):
 		{
 		  bool error;
-		  //double fl = stringToDouble(left.c_str(), error);
+#ifdef ROPE_C_STR_BROKEN
+		  //
+		  //	This kudge doesn't seem to be need nowadays, but copy() doesn't work.
 		  //
 		  //	This messing about is needed because Rope::c_str()
 		  //	fails in libstdc++-v3
@@ -231,7 +233,9 @@ StringOpSymbol::eqRewrite(DagNode* subje
 		  t[len] = '\0';
 		  double fl = stringToDouble(t, error);
 		  delete [] t;
-		  //
+#else
+		  double fl = stringToDouble(left.c_str(), error);
+#endif
 		  if (error)
 		    goto fail;
 		  return floatSymbol->rewriteToFloat(subject, context, fl);
@@ -282,6 +286,7 @@ StringOpSymbol::eqRewrite(DagNode* subje
 		    break;
 		  default:
 		    CantHappen("bad string op");
+		    r = false;  // avoid compiler warning
 		  }
 		Assert(trueTerm.getTerm() != 0 && falseTerm.getTerm() != 0,
 		       "null true/false for relational op");
@@ -358,6 +363,7 @@ StringOpSymbol::eqRewrite(DagNode* subje
 			      break;
 			    default:
 			      CantHappen("bad string op");
+			      r = 0;  // avoid compiler warning
 			    }
 			  Assert(notFoundTerm.getTerm() != 0, "null notFound for find op");
 			  if (r == NONE)
@@ -591,6 +597,13 @@ StringOpSymbol::ropeToNumber(const crope
 		  if (!isalnum(subject[j]))
 		    return false;
 		}
+	      //
+	      //	We have detected a fraction form.
+	      //
+#ifdef ROPE_C_STR_BROKEN
+	      //
+	      //	This kudge doesn't seem to be need nowadays, but copy() doesn't work.
+	      //
 	      char* t = new char[len];  // longer than needed but who cares
 	      int dLen = len - (i + 1);
 	      subject.copy(i + 1, dLen, t);
@@ -609,20 +622,34 @@ StringOpSymbol::ropeToNumber(const crope
 		}
 	      delete [] t;
 	      return true;
+#else
+	      return mpz_set_str(denominator.get_mpz_t(), subject.substr(i + 1).c_str(), base) == 0 &&
+		mpz_set_str(numerator.get_mpz_t(), subject.substr(0,i).c_str(), base) == 0;
+#endif	      
 	    }
 	  else
 	    return false;
 	}
     }
+  //
+  //	We have a regular integer form.
+  //
+  denominator = 0;
+#ifdef ROPE_C_STR_BROKEN
+  //
+  //	This kudge doesn't seem to be need nowadays, but copy() doesn't work.
+  //
   char* t = new char[len + 1];
   subject.copy(t);
   t[len] = '\0';
   if (mpz_set_str(numerator.get_mpz_t(), t, base) == 0)
     {
       delete [] t;
-      denominator = 0;
       return true;
     }
   delete [] t;
-  return false;    
+  return false;
+#else
+  return mpz_set_str(numerator.get_mpz_t(), subject.c_str(), base) == 0;
+#endif
 }
--- Maude-2.3/src/Utility/macros.hh	2007-01-11 21:13:21.000000000 -0600
+++ Maude-2.4/src/Utility/macros.hh	2008-09-04 13:52:55.000000000 -0600
@@ -50,10 +50,10 @@
 #if HAVE_CTYPE_H
 #include <ctype.h>
 #endif
-#if HAVE_STRINGS_H
-#include <strings.h>
-#elif HAVE_STRING_H
+#if HAVE_STRING_H
 #include <string.h>
+#elif HAVE_STRINGS_H
+#include <strings.h>
 #endif
 #if HAVE_UNISTD_H
 #include <unistd.h>  // needed by solaris






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-10  5:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-10  5:01 [gentoo-commits] gentoo-x86 commit in dev-lang/maude/files: maude-2.3.0-gcc43.patch Ryan Hill (dirtyepic)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox