Commit 3bf60950f7c44319150c1173667d6d4b79fbf18d

Werner Lemberg 2013-12-21T08:49:11

[autofit] Make PIC mode work actually. * src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the enumeration values automatically generated by including `afscript.h' and friends. * src/autofit/afpic.c (autofit_module_class_pic_init): Updated.

diff --git a/ChangeLog b/ChangeLog
index f29d23c..7937534 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2013-12-21  Werner Lemberg  <wl@gnu.org>
 
+	[autofit] Make PIC mode work actually.
+
+	* src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the
+	enumeration values automatically generated by including `afscript.h'
+	and friends.
+
+	* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
+
+2013-12-21  Werner Lemberg  <wl@gnu.org>
+
 	Fix PIC linking.
 
 	* include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix
diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c
index 1806895..eba6a89 100644
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -98,20 +98,20 @@
 
     FT_Init_Class_af_service_properties( &container->af_service_properties );
 
-    for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX - 1; ss++ )
+    for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )
       container->af_writing_system_classes[ss] =
         &container->af_writing_system_classes_rec[ss];
-    container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX - 1] = NULL;
+    container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;
 
-    for ( ss = 0; ss < AF_SCRIPT_MAX - 1; ss++ )
+    for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )
       container->af_script_classes[ss] =
         &container->af_script_classes_rec[ss];
-    container->af_script_classes[AF_SCRIPT_MAX - 1] = NULL;
+    container->af_script_classes[AF_SCRIPT_MAX] = NULL;
 
-    for ( ss = 0; ss < AF_STYLE_MAX - 1; ss++ )
+    for ( ss = 0; ss < AF_STYLE_MAX; ss++ )
       container->af_style_classes[ss] =
         &container->af_style_classes_rec[ss];
-    container->af_style_classes[AF_STYLE_MAX - 1] = NULL;
+    container->af_style_classes[AF_STYLE_MAX] = NULL;
 
 #undef  WRITING_SYSTEM
 #define WRITING_SYSTEM( ws, WS )                             \
diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h
index 951628f..9a68b4a 100644
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -49,19 +49,19 @@ FT_BEGIN_HEADER
     FT_Service_PropertiesRec    af_service_properties;
 
     AF_WritingSystemClass       af_writing_system_classes
-                                  [AF_WRITING_SYSTEM_MAX];
+                                  [AF_WRITING_SYSTEM_MAX + 1];
     AF_WritingSystemClassRec    af_writing_system_classes_rec
-                                  [AF_WRITING_SYSTEM_MAX - 1];
+                                  [AF_WRITING_SYSTEM_MAX];
 
     AF_ScriptClass              af_script_classes
-                                  [AF_SCRIPT_MAX];
+                                  [AF_SCRIPT_MAX + 1];
     AF_ScriptClassRec           af_script_classes_rec
-                                  [AF_SCRIPT_MAX - 1];
+                                  [AF_SCRIPT_MAX];
 
     AF_StyleClass               af_style_classes
-                                  [AF_STYLE_MAX];
+                                  [AF_STYLE_MAX + 1];
     AF_StyleClassRec            af_style_classes_rec
-                                  [AF_STYLE_MAX - 1];
+                                  [AF_STYLE_MAX];
 
     FT_AutoHinter_InterfaceRec  af_autofitter_interface;