diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-05 18:26:46 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-05 18:26:46 +0000 |
commit | 3dbacabc55535dcff956db1d40c5f6d85973176f (patch) | |
tree | a81b00d7afe6e1e0629397bdddd0a8910060570f | |
parent | a599743cdc4864b233200300e65b52def6b8072b (diff) | |
download | guile-3dbacabc55535dcff956db1d40c5f6d85973176f.tar.gz |
* num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about
testing an unsigned value for being >= 0.
-rw-r--r-- | libguile/ChangeLog | 5 | ||||
-rw-r--r-- | 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,5 +1,10 @@ 2001-10-05 Dirk Herrmann <D.Herrmann@tu-bs.de> + * num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about + testing an unsigned value for being >= 0. + +2001-10-05 Dirk Herrmann <D.Herrmann@tu-bs.de> + * numbers.h: Removed old comment about using SCM_CAR to access non-pair cells. 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); |