[cff] Formatting, minor code clean-ups.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index b12a8d3..011696b 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -609,8 +609,10 @@
#define CFFCODE_TOPDICT 0x1000
#define CFFCODE_PRIVATE 0x2000
+
#ifndef FT_CONFIG_OPTION_PIC
+
#define CFF_FIELD_CALLBACK( code, name ) \
{ \
cff_kind_callback, \
@@ -622,12 +624,12 @@
#undef CFF_FIELD
#define CFF_FIELD( code, name, kind ) \
- { \
- kind, \
- code | CFFCODE, \
- FT_FIELD_OFFSET( name ), \
- FT_FIELD_SIZE( name ), \
- 0, 0, 0 \
+ { \
+ kind, \
+ code | CFFCODE, \
+ FT_FIELD_OFFSET( name ), \
+ FT_FIELD_SIZE( name ), \
+ 0, 0, 0 \
},
#undef CFF_FIELD_DELTA
@@ -653,81 +655,91 @@
#else /* FT_CONFIG_OPTION_PIC */
- void FT_Destroy_Class_cff_field_handlers(FT_Library library, CFF_Field_Handler* clazz)
+
+ void
+ FT_Destroy_Class_cff_field_handlers( FT_Library library,
+ CFF_Field_Handler* clazz )
{
- FT_Memory memory = library->memory;
+ FT_Memory memory = library->memory;
+
+
if ( clazz )
FT_FREE( clazz );
}
- FT_Error FT_Create_Class_cff_field_handlers(FT_Library library, CFF_Field_Handler** output_class)
+
+ FT_Error
+ FT_Create_Class_cff_field_handlers( FT_Library library,
+ CFF_Field_Handler** output_class )
{
CFF_Field_Handler* clazz;
- FT_Error error;
- FT_Memory memory = library->memory;
- int i=0;
+ FT_Error error;
+ FT_Memory memory = library->memory;
+
+ int i = 0;
+
#undef CFF_FIELD
+#define CFF_FIELD( code, name, kind ) i++;
#undef CFF_FIELD_DELTA
+#define CFF_FIELD_DELTA( code, name, max ) i++;
#undef CFF_FIELD_CALLBACK
#define CFF_FIELD_CALLBACK( code, name ) i++;
-#define CFF_FIELD( code, name, kind ) i++;
-#define CFF_FIELD_DELTA( code, name, max ) i++;
#include "cfftoken.h"
- i++;/*{ 0, 0, 0, 0, 0, 0, 0 }*/
- if ( FT_ALLOC( clazz, sizeof(CFF_Field_Handler)*i ) )
+ i++; /* { 0, 0, 0, 0, 0, 0, 0 } */
+
+ if ( FT_ALLOC( clazz, sizeof ( CFF_Field_Handler ) * i ) )
return error;
- i=0;
-#undef CFF_FIELD
-#undef CFF_FIELD_DELTA
-#undef CFF_FIELD_CALLBACK
+ i = 0;
-#define CFF_FIELD_CALLBACK( code_, name_ ) \
- clazz[i].kind = cff_kind_callback; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = 0; \
- clazz[i].size = 0; \
- clazz[i].reader = cff_parse_ ## name_; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- i++;
+#undef CFF_FIELD_CALLBACK
+#define CFF_FIELD_CALLBACK( code_, name_ ) \
+ clazz[i].kind = cff_kind_callback; \
+ clazz[i].code = code_ | CFFCODE; \
+ clazz[i].offset = 0; \
+ clazz[i].size = 0; \
+ clazz[i].reader = cff_parse_ ## name_; \
+ clazz[i].array_max = 0; \
+ clazz[i].count_offset = 0; \
+ i++;
#undef CFF_FIELD
-#define CFF_FIELD( code_, name_, kind_ ) \
- clazz[i].kind = kind_; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = 0; \
- clazz[i].count_offset = 0; \
- i++; \
+#define CFF_FIELD( code_, name_, kind_ ) \
+ clazz[i].kind = kind_; \
+ clazz[i].code = code_ | CFFCODE; \
+ clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
+ clazz[i].size = FT_FIELD_SIZE( name_ ); \
+ clazz[i].reader = 0; \
+ clazz[i].array_max = 0; \
+ clazz[i].count_offset = 0; \
+ i++; \
#undef CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code_, name_, max_ ) \
- clazz[i].kind = cff_kind_delta; \
- clazz[i].code = code_ | CFFCODE; \
- clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
- clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
- clazz[i].reader = 0; \
- clazz[i].array_max = max_; \
- clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
- i++;
+#define CFF_FIELD_DELTA( code_, name_, max_ ) \
+ clazz[i].kind = cff_kind_delta; \
+ clazz[i].code = code_ | CFFCODE; \
+ clazz[i].offset = FT_FIELD_OFFSET( name_ ); \
+ clazz[i].size = FT_FIELD_SIZE_DELTA( name_ ); \
+ clazz[i].reader = 0; \
+ clazz[i].array_max = max_; \
+ clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
+ i++;
#include "cfftoken.h"
- clazz[i].kind = 0;
- clazz[i].code = 0;
- clazz[i].offset = 0;
- clazz[i].size = 0;
- clazz[i].reader = 0;
- clazz[i].array_max = 0;
+ clazz[i].kind = 0;
+ clazz[i].code = 0;
+ clazz[i].offset = 0;
+ clazz[i].size = 0;
+ clazz[i].reader = 0;
+ clazz[i].array_max = 0;
clazz[i].count_offset = 0;
*output_class = clazz;
+
return CFF_Err_Ok;
}
@@ -743,7 +755,7 @@
FT_Byte* p = start;
FT_Error error = CFF_Err_Ok;
FT_Library library = parser->library;
- FT_UNUSED(library);
+ FT_UNUSED( library );
parser->top = parser->stack;