1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

(SCM_CHARSET_GET): Cast IDX to unsigned char so that it works for

8-bit characters.  Thanks to Matthias Koeppe!  No, make that "Köppe".
This commit is contained in:
Marius Vollmer 2002-05-06 18:43:54 +00:00
parent d47fd163a9
commit 139e5cb2fb

View file

@ -60,15 +60,15 @@
#define SCM_CHARSET_SIZE 256
/* We expect 8-bit bytes here. Shoule be no problem in the year
/* We expect 8-bit bytes here. Should 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) / SCM_BITS_PER_LONG] &\
(1L << ((idx) % SCM_BITS_PER_LONG)))
[((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\
(1L << (((unsigned char) (idx)) % SCM_BITS_PER_LONG)))
#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))