]> granicus.if.org Git - yasm/commitdiff
* intnum.c (yasm_intnum_get_sized): Honor negative warn setting (signed).
authorPeter Johnson <peter@tortall.net>
Fri, 10 Feb 2006 04:09:38 +0000 (04:09 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 10 Feb 2006 04:09:38 +0000 (04:09 -0000)
* intnum.h (yasm_intnum_check_size): Remove reference to nonexistent param
"is_signed" (this was replaced a long time ago with the rangetype param).

svn path=/trunk/yasm/; revision=1368

libyasm/intnum.c
libyasm/intnum.h

index 6329f41eca524075e106c76d17d281306d3a762c..5e22dc47ff8a0f297439132a2080e43590ce1748 100644 (file)
@@ -559,7 +559,11 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr,
        yasm_internal_error(N_("destination too large"));
 
     /* General size warnings */
-    if (warn && !yasm_intnum_check_size(intn, valsize, rshift, 2))
+    if (warn<0 && !yasm_intnum_check_size(intn, valsize, rshift, 1))
+       yasm__warning(YASM_WARN_GENERAL, line,
+                     N_("value does not fit in signed %d bit field"),
+                     valsize);
+    if (warn>0 && !yasm_intnum_check_size(intn, valsize, rshift, 2))
        yasm__warning(YASM_WARN_GENERAL, line,
                      N_("value does not fit in %d bit field"), valsize);
 
index e05ac1c8fa444861beb7f1550f8b13a8f030e4b0..9cb4f66cbfff4418d87e04c818724cc818ce8229 100644 (file)
@@ -185,7 +185,6 @@ void yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr,
                           int bigendian, int warn, unsigned long line);
 
 /** Check to see if intnum will fit without overflow into size bits.
- * If is_signed is 1, intnum is treated as a signed number.
  * \param intn     intnum
  * \param size     number of bits of output space
  * \param rshift    right shift