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:
parent
d47fd163a9
commit
139e5cb2fb
1 changed files with 3 additions and 3 deletions
|
@ -60,15 +60,15 @@
|
||||||
|
|
||||||
#define SCM_CHARSET_SIZE 256
|
#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. */
|
2001. */
|
||||||
#ifndef SCM_BITS_PER_LONG
|
#ifndef SCM_BITS_PER_LONG
|
||||||
# define SCM_BITS_PER_LONG (sizeof (long) * 8)
|
# define SCM_BITS_PER_LONG (sizeof (long) * 8)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
|
#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
|
||||||
[(idx) / SCM_BITS_PER_LONG] &\
|
[((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\
|
||||||
(1L << ((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))
|
#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue