mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
* vectors.h (SCM_VELTS_AS_STACKITEMS): Added this macro to help in
eliminating some warnings. * unif.c, strports.c, print.c, options.c: Fix some warnings on mis-use of SCM/long * gc.c, gc.h: Added scm_return_first_int(), and added comment re: what the scm_return_first* functions do.
This commit is contained in:
parent
7ac030d6de
commit
41b0806d3e
7 changed files with 25 additions and 11 deletions
|
@ -1920,6 +1920,7 @@ SCM_DEFINE (scm_bit_count_star, "bit-count*", 3, 0, 0,
|
|||
{
|
||||
register long i, vlen, count = 0;
|
||||
register unsigned long k;
|
||||
int fObj = 0;
|
||||
|
||||
SCM_ASRTGO (SCM_NIMP (v), badarg1);
|
||||
SCM_ASRTGO (SCM_NIMP (kv), badarg2);
|
||||
|
@ -1962,9 +1963,9 @@ SCM_DEFINE (scm_bit_count_star, "bit-count*", 3, 0, 0,
|
|||
if (0 == SCM_LENGTH (v))
|
||||
return SCM_INUM0;
|
||||
SCM_ASRTGO (SCM_BOOL_T == obj || SCM_BOOL_F == obj, badarg3);
|
||||
obj = (SCM_BOOL_T == obj); /* ugh. */
|
||||
fObj = (SCM_BOOL_T == obj);
|
||||
i = (SCM_LENGTH (v) - 1) / SCM_LONG_BIT;
|
||||
k = SCM_ASWORD (SCM_VELTS (kv)[i]) & (obj ? SCM_ASWORD (SCM_VELTS (v)[i]) : ~ SCM_ASWORD (SCM_VELTS (v)[i]));
|
||||
k = SCM_ASWORD (SCM_VELTS (kv)[i]) & (fObj ? SCM_ASWORD (SCM_VELTS (v)[i]) : ~ SCM_ASWORD (SCM_VELTS (v)[i]));
|
||||
k <<= SCM_LONG_BIT - 1 - ((SCM_LENGTH (v) - 1) % SCM_LONG_BIT);
|
||||
while (1)
|
||||
{
|
||||
|
@ -1974,7 +1975,7 @@ SCM_DEFINE (scm_bit_count_star, "bit-count*", 3, 0, 0,
|
|||
return SCM_MAKINUM (count);
|
||||
|
||||
/* urg. repetitive (see above.) */
|
||||
k = SCM_ASWORD (SCM_VELTS (kv)[i]) & (obj ? SCM_ASWORD(SCM_VELTS (v)[i]) : ~SCM_ASWORD (SCM_VELTS (v)[i]));
|
||||
k = SCM_ASWORD (SCM_VELTS (kv)[i]) & (fObj ? SCM_ASWORD(SCM_VELTS (v)[i]) : ~SCM_ASWORD (SCM_VELTS (v)[i]));
|
||||
}
|
||||
}
|
||||
return SCM_MAKINUM (count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue