From: "Ryan Hill (dirtyepic)" <dirtyepic@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/maude/files: maude-2.3.0-gcc43.patch
Date: Tue, 10 Feb 2009 05:01:37 +0000 [thread overview]
Message-ID: <E1LWkkb-00067O-Vz@stork.gentoo.org> (raw)
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
reply other threads:[~2009-02-10 5:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1LWkkb-00067O-Vz@stork.gentoo.org \
--to=dirtyepic@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox