mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
(scm_char_set_hash): bug fix: was overrunning the buffer and
calculating based on garbage. (scm_char_set_eq, scm_char_set_leq): fix argument number in error reporting: wasn't incremented due to macro coding. (scm_char_set): report argument number in error reporting: was hard coded to 1. remove a couple of local variables.
This commit is contained in:
parent
396f36cdbf
commit
b87f5a8394
2 changed files with 17 additions and 10 deletions
|
@ -3,6 +3,12 @@
|
|||
* srfi-14.c (scm_char_set_hash): recognise 0 instead of #f in the
|
||||
opt arg to give default bound, as in final spec. don't allow
|
||||
negative bounds.
|
||||
(scm_char_set_hash): bug fix: was overrunning the buffer and
|
||||
calculating based on garbage.
|
||||
(scm_char_set_eq, scm_char_set_leq): fix argument number in error
|
||||
reporting: wasn't incremented due to macro coding.
|
||||
(scm_char_set): report argument number in error reporting: was
|
||||
hard coded to 1. remove a couple of local variables.
|
||||
|
||||
2001-07-13 Marius Vollmer <mvo@zagadka.ping.de>
|
||||
|
||||
|
|
|
@ -126,7 +126,8 @@ SCM_DEFINE (scm_char_set_eq, "char-set=", 0, 0, 1,
|
|||
SCM csi = SCM_CAR (char_sets);
|
||||
long *csi_data;
|
||||
|
||||
SCM_VALIDATE_SMOB (argnum++, csi, charset);
|
||||
SCM_VALIDATE_SMOB (argnum, csi, charset);
|
||||
argnum++;
|
||||
csi_data = (long *) SCM_SMOB_DATA (csi);
|
||||
if (cs1_data == NULL)
|
||||
cs1_data = csi_data;
|
||||
|
@ -155,7 +156,8 @@ SCM_DEFINE (scm_char_set_leq, "char-set<=", 0, 0, 1,
|
|||
SCM csi = SCM_CAR (char_sets);
|
||||
long *csi_data;
|
||||
|
||||
SCM_VALIDATE_SMOB (argnum++, csi, charset);
|
||||
SCM_VALIDATE_SMOB (argnum, csi, charset);
|
||||
argnum++;
|
||||
csi_data = (long *) SCM_SMOB_DATA (csi);
|
||||
if (prev_data)
|
||||
{
|
||||
|
@ -200,7 +202,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
|
|||
}
|
||||
|
||||
p = (long *) SCM_SMOB_DATA (cs);
|
||||
for (k = 0; k < SCM_CHARSET_SIZE - 1; k++)
|
||||
for (k = 0; k < SCM_CHARSET_SIZE / sizeof (long); k++)
|
||||
{
|
||||
val = p[k] ^ val;
|
||||
}
|
||||
|
@ -458,21 +460,20 @@ SCM_DEFINE (scm_char_set, "char-set", 0, 0, 1,
|
|||
"Return a character set containing all given characters.")
|
||||
#define FUNC_NAME s_scm_char_set
|
||||
{
|
||||
SCM cs, ls;
|
||||
SCM cs;
|
||||
long * p;
|
||||
int argnum = 1;
|
||||
|
||||
SCM_VALIDATE_REST_ARGUMENT (rest);
|
||||
ls = rest;
|
||||
cs = make_char_set (FUNC_NAME);
|
||||
p = (long *) SCM_SMOB_DATA (cs);
|
||||
while (!SCM_NULLP (ls))
|
||||
while (!SCM_NULLP (rest))
|
||||
{
|
||||
SCM chr = SCM_CAR (ls);
|
||||
int c;
|
||||
|
||||
SCM_VALIDATE_CHAR_COPY (1, chr, c);
|
||||
ls = SCM_CDR (ls);
|
||||
|
||||
SCM_VALIDATE_CHAR_COPY (argnum, SCM_CAR (rest), c);
|
||||
argnum++;
|
||||
rest = SCM_CDR (rest);
|
||||
p[c / sizeof (long)] |= 1 << (c % sizeof (long));
|
||||
}
|
||||
return cs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue