1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

* srfi-14.c: Fix for bug caused by brain-malfunctioning on my

side.  Bit sets were handled wrong because I couldn't tell bit
	counts from byte counts.  Also, the bit array should be 256 / 8
	bytes long.  Thank you, Gary!

	Removed unnecessary protoype for scm_char_set_copy.
This commit is contained in:
Martin Grabmüller 2001-07-17 05:37:25 +00:00
parent 38038d4c6c
commit 8ae7ecf74e
3 changed files with 39 additions and 24 deletions

View file

@ -48,8 +48,15 @@
#define SCM_CHARSET_SIZE 256
/* We expect 8-bit bytes here. Shoule be no problem in the year
2001. */
#ifndef SCM_BITS_PER_LONG
# define SCM_BITS_PER_LONG (sizeof (long) * 8)
#endif
#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
[(idx) / sizeof (long)] & (1 << ((idx) % sizeof (long))))
[(idx) / SCM_BITS_PER_LONG] &\
(1 << ((idx) % SCM_BITS_PER_LONG)))
#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))