From d8c7ca6d3bc7e1735b3ffda2d34d329e73704d78 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 10 Feb 2006 04:09:38 +0000 Subject: [PATCH] * intnum.c (yasm_intnum_get_sized): Honor negative warn setting (signed). * 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 | 6 +++++- libyasm/intnum.h | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 6329f41e..5e22dc47 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -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); diff --git a/libyasm/intnum.h b/libyasm/intnum.h index e05ac1c8..9cb4f66c 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -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 -- 2.50.1