From 3dbacabc55535dcff956db1d40c5f6d85973176f Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 5 Oct 2001 18:26:46 +0000 Subject: [PATCH] * num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about testing an unsigned value for being >= 0. --- libguile/ChangeLog | 5 +++++ libguile/num2integral.i.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 84b3e814c..d01beda16 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2001-10-05 Dirk Herrmann + + * num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about + testing an unsigned value for being >= 0. + 2001-10-05 Dirk Herrmann * numbers.h: Removed old comment about using SCM_CAR to access diff --git a/libguile/num2integral.i.c b/libguile/num2integral.i.c index 61b1255c8..29e7effc0 100644 --- a/libguile/num2integral.i.c +++ b/libguile/num2integral.i.c @@ -35,6 +35,11 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) ITYPE res = 0; size_t l; +#ifdef UNSIGNED + if (SCM_BIGSIGN (num)) + scm_out_of_range (s_caller, num); +#endif + for (l = SCM_NUMDIGS (num); l--;) { ITYPE new = SCM_I_BIGUP (ITYPE, res) + SCM_BDIGITS (num)[l]; @@ -47,10 +52,10 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) res = new; } - if (SCM_BIGSIGN (num)) #ifdef UNSIGNED - scm_out_of_range (s_caller, num); + return res; #else + if (SCM_BIGSIGN (num)) { res = -res; if (res <= 0) @@ -58,7 +63,6 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) else scm_out_of_range (s_caller, num); } -#endif else { if (res >= 0) @@ -66,8 +70,7 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) else scm_out_of_range (s_caller, num); } - - return res; +#endif } else scm_wrong_type_arg (s_caller, pos, num);