mpint.c (touint): Compare unsigned with unsigned, not unsigned long.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 3 May 2012 09:54:16 +0000 (10:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 3 May 2012 09:54:16 +0000 (10:54 +0100)
Otherwise the tests fail on LP64 platforms.

mpint.c

diff --git a/mpint.c b/mpint.c
index 244ff9a..7c1b8cc 100644 (file)
--- a/mpint.c
+++ b/mpint.c
@@ -128,7 +128,7 @@ static int touint(dstr *v)
   unsigned j = mp_touint(m);
   int ok = 1;
 
   unsigned j = mp_touint(m);
   int ok = 1;
 
-  if (i != j) {
+  if ((unsigned)i != j) {
     fputs("\n*** touint failed.\n", stderr);
     fputs("m = ", stderr); mp_writefile(m, stderr, 10);
     fprintf(stderr, "\nexpect = %lu; result = %u\n", i, j);
     fputs("\n*** touint failed.\n", stderr);
     fputs("m = ", stderr); mp_writefile(m, stderr, 10);
     fprintf(stderr, "\nexpect = %lu; result = %u\n", i, j);