1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

* srfi-14.c (SCM_CHARSET_SET): need 1L, not just 1 in "<<".

(scm_char_set_hash): val needs to be long, not just unsigned.
(scm_char_set): need 1L, not just 1 in "<<".
(scm_list_to_char_set): need 1L, not just 1 in "<<".
(scm_list_to_char_set_x): need 1L, not just 1 in "<<".
(scm_list_to_char_set_x): FUNC_NAME was wrong - added a _x.
(scm_string_to_char_set): string length var needed to be
scm_sizet, not int.
(scm_string_to_char_set): need 1L, not just 1 in "<<".
(scm_string_to_char_set_x): string length var needed to be
scm_sizet, not int.
(scm_string_to_char_set_x): need 1L, not just 1 in "<<".
(scm_char_set_filter): need 1L, not just 1 in "<<".
(scm_char_set_filter_x): need 1L, not just 1 in "<<".
(scm_ucs_range_to_char_set): need 1L, not just 1 in "<<".
(scm_ucs_range_to_char_set_x): need 1L, not just 1 in "<<".
(scm_char_set_adjoin): need 1L, not just 1 in "<<".
(scm_char_set_delete): need 1L, not just 1 in "<<".
(scm_char_set_adjoin_x): need 1L, not just 1 in "<<".
(scm_char_set_delete_x): need 1L, not just 1 in "<<".
This commit is contained in:
Rob Browning 2001-09-21 17:55:07 +00:00
parent 3a868e486c
commit cc0ce1e764

View file

@ -51,8 +51,9 @@
#include "srfi-14.h"
#define SCM_CHARSET_SET(cs, idx) (((long *) SCM_SMOB_DATA (cs))[(idx) / SCM_BITS_PER_LONG] |= (1 << ((idx) % SCM_BITS_PER_LONG)))
#define SCM_CHARSET_SET(cs, idx) \
(((long *) SCM_SMOB_DATA (cs))[(idx) / SCM_BITS_PER_LONG] |= \
(1L << ((idx) % SCM_BITS_PER_LONG)))
#define BYTES_PER_CHARSET (SCM_CHARSET_SIZE / 8)
#define LONGS_PER_CHARSET (SCM_CHARSET_SIZE / SCM_BITS_PER_LONG)
@ -191,7 +192,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
const int default_bnd = 871;
int bnd;
long * p;
unsigned val = 0;
unsigned long val = 0;
int k;
SCM_VALIDATE_SMOB (1, cs, charset);
@ -479,7 +480,7 @@ SCM_DEFINE (scm_char_set, "char-set", 0, 0, 1,
SCM_VALIDATE_CHAR_COPY (argnum, SCM_CAR (rest), c);
argnum++;
rest = SCM_CDR (rest);
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return cs;
}
@ -513,7 +514,7 @@ SCM_DEFINE (scm_list_to_char_set, "list->char-set", 1, 1, 0,
SCM_VALIDATE_CHAR_COPY (0, chr, c);
list = SCM_CDR (list);
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return cs;
}
@ -525,7 +526,7 @@ SCM_DEFINE (scm_list_to_char_set_x, "list->char-set!", 2, 0, 0,
"Convert the character list @var{list} to a character set. The\n"
"characters are added to @var{base_cs} and @var{base_cs} is\n"
"returned.")
#define FUNC_NAME s_scm_list_to_char_set
#define FUNC_NAME s_scm_list_to_char_set_x
{
long * p;
@ -540,7 +541,7 @@ SCM_DEFINE (scm_list_to_char_set_x, "list->char-set!", 2, 0, 0,
SCM_VALIDATE_CHAR_COPY (0, chr, c);
list = SCM_CDR (list);
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return base_cs;
}
@ -557,7 +558,7 @@ SCM_DEFINE (scm_string_to_char_set, "string->char-set", 1, 1, 0,
SCM cs;
long * p;
char * s;
int k = 0;
size_t k = 0;
SCM_VALIDATE_STRING (1, str);
if (SCM_UNBNDP (base_cs))
@ -572,7 +573,7 @@ SCM_DEFINE (scm_string_to_char_set, "string->char-set", 1, 1, 0,
while (k < SCM_STRING_LENGTH (str))
{
int c = s[k++];
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return cs;
}
@ -588,7 +589,7 @@ SCM_DEFINE (scm_string_to_char_set_x, "string->char-set!", 2, 0, 0,
{
long * p;
char * s;
int k = 0;
size_t k = 0;
SCM_VALIDATE_STRING (1, str);
SCM_VALIDATE_SMOB (2, base_cs, charset);
@ -597,7 +598,7 @@ SCM_DEFINE (scm_string_to_char_set_x, "string->char-set!", 2, 0, 0,
while (k < SCM_STRING_LENGTH (str))
{
int c = s[k++];
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return base_cs;
}
@ -632,7 +633,7 @@ SCM_DEFINE (scm_char_set_filter, "char-set-filter", 2, 1, 0,
SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
if (!SCM_FALSEP (res))
p[k / SCM_BITS_PER_LONG] |= 1 << (k % SCM_BITS_PER_LONG);
p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG);
}
}
return ret;
@ -661,7 +662,7 @@ SCM_DEFINE (scm_char_set_filter_x, "char-set-filter!", 3, 0, 0,
SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
if (!SCM_FALSEP (res))
p[k / SCM_BITS_PER_LONG] |= 1 << (k % SCM_BITS_PER_LONG);
p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG);
}
}
return base_cs;
@ -715,7 +716,7 @@ SCM_DEFINE (scm_ucs_range_to_char_set, "ucs-range->char-set", 2, 2, 0,
p = (long *) SCM_SMOB_DATA (cs);
while (clower < cupper)
{
p[clower / SCM_BITS_PER_LONG] |= 1 << (clower % SCM_BITS_PER_LONG);
p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG);
clower++;
}
return cs;
@ -758,7 +759,7 @@ SCM_DEFINE (scm_ucs_range_to_char_set_x, "ucs-range->char-set!", 4, 0, 0,
p = (long *) SCM_SMOB_DATA (base_cs);
while (clower < cupper)
{
p[clower / SCM_BITS_PER_LONG] |= 1 << (clower % SCM_BITS_PER_LONG);
p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG);
clower++;
}
return base_cs;
@ -931,7 +932,7 @@ SCM_DEFINE (scm_char_set_adjoin, "char-set-adjoin", 1, 0, 1,
SCM_VALIDATE_CHAR_COPY (1, chr, c);
rest = SCM_CDR (rest);
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return cs;
}
@ -959,7 +960,7 @@ SCM_DEFINE (scm_char_set_delete, "char-set-delete", 1, 0, 1,
SCM_VALIDATE_CHAR_COPY (1, chr, c);
rest = SCM_CDR (rest);
p[c / SCM_BITS_PER_LONG] &= ~(1 << (c % SCM_BITS_PER_LONG));
p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG));
}
return cs;
}
@ -986,7 +987,7 @@ SCM_DEFINE (scm_char_set_adjoin_x, "char-set-adjoin!", 1, 0, 1,
SCM_VALIDATE_CHAR_COPY (1, chr, c);
rest = SCM_CDR (rest);
p[c / SCM_BITS_PER_LONG] |= 1 << (c % SCM_BITS_PER_LONG);
p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
}
return cs;
}
@ -1013,7 +1014,7 @@ SCM_DEFINE (scm_char_set_delete_x, "char-set-delete!", 1, 0, 1,
SCM_VALIDATE_CHAR_COPY (1, chr, c);
rest = SCM_CDR (rest);
p[c / SCM_BITS_PER_LONG] &= ~(1 << (c % SCM_BITS_PER_LONG));
p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG));
}
return cs;
}