Correct types in BIGNUM_REDUCE_LENGTH and use output parameter as such.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 26 Apr 2014 21:00:01 +0000 (21:00 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 26 Apr 2014 21:00:01 +0000 (21:00 +0000)
src/microcode/bignmint.h

index e644716b0b566215995c967ca72a0b632ced40de..0f8e2414b3a26fdebb005e02af1cd46f3dfb7bd0 100644 (file)
@@ -56,11 +56,11 @@ typedef long bignum_length_type;
    space when a bignum's length is reduced from its original value. */
 #define BIGNUM_REDUCE_LENGTH(target, source, length)                   \
 {                                                                      \
-  int new_gc_length = BIGNUM_LENGTH_TO_GC_LENGTH (length);             \
-  int old_gc_length = VECTOR_LENGTH (source);                          \
-  int delta = old_gc_length - new_gc_length;                           \
-  assert (delta >= 0);                                                 \
-  assert ((target) == (source));                                       \
+  unsigned long new_gc_length = (BIGNUM_LENGTH_TO_GC_LENGTH (length)); \
+  unsigned long old_gc_length = (VECTOR_LENGTH (source));              \
+  unsigned long delta;                                                 \
+  assert (new_gc_length <= old_gc_length);                             \
+  delta = (old_gc_length - new_gc_length);                             \
   if (delta == 1)                                                      \
     VECTOR_SET (source, new_gc_length, SHARP_F);                       \
   else if (delta > 1)                                                  \
@@ -68,6 +68,7 @@ typedef long bignum_length_type;
                (MAKE_OBJECT (TC_MANIFEST_NM_VECTOR, delta - 1)));      \
   if (delta != 0)                                                      \
     SET_VECTOR_LENGTH (source, new_gc_length);                         \
+  (target) = (source);                                                 \
 }
 
 #define BIGNUM_LENGTH_TO_GC_LENGTH(length)                             \