more space efficient unicode tables
[disorder] / lib / charset.c
index 3f0e8bc..c763d10 100644 (file)
@@ -181,9 +181,9 @@ int ucs4cmp(const uint32_t *a, const uint32_t *b) {
 /** @brief Return nonzero if @p c is a combining character */
 static int combining(int c) {
   if(c < UNICODE_NCHARS) {
-    const struct unidata *const ud = &unidata[c / 256][c % 256];
+    const struct unidata *const ud = &unidata[c / UNICODE_MODULUS][c % UNICODE_MODULUS];
 
-    return ud->gc == unicode_gc_Mn || ud->ccc != 0;
+    return ud->general_category == unicode_General_Category_Mn || ud->ccc != 0;
   }
   /* Assume unknown characters are noncombining */
   return 0;