(SCM_CHARSET_GET): Cast IDX to unsigned char so that it works for
authorMarius Vollmer <mvo@zagadka.de>
Mon, 6 May 2002 18:43:54 +0000 (18:43 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Mon, 6 May 2002 18:43:54 +0000 (18:43 +0000)
8-bit characters.  Thanks to Matthias Koeppe!  No, make that "Köppe".

srfi/srfi-14.h

index 816ef0a..d6155fa 100644 (file)
 
 #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))