mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
* num2integral.i.c (NUM2INTEGRAL): Eliminated some warnings about
testing an unsigned value for being >= 0.
This commit is contained in:
parent
a599743cdc
commit
3dbacabc55
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue