From 6d4016f1ba48d409800dc3281b93e5cd58c99d9f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 Mar 2012 15:33:14 -0500 Subject: [PATCH] Make src tests pass again --- src/gen-arabic-table.py | 11 ++++++----- src/gen-indic-table.py | 9 +++++---- src/hb-ot-shape-complex-arabic-table.hh | 6 ++++++ src/hb-ot-shape-complex-indic-table.hh | 4 ++++ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py index 8744fabde..32bf66cf6 100755 --- a/src/gen-arabic-table.py +++ b/src/gen-arabic-table.py @@ -24,11 +24,13 @@ print " *" for line in header: print " * %s" % (line.strip()) print " */" - +print +print "#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH" +print "#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH" +print print "static const uint8_t joining_table[] =" print "{" - min_u = 0x110000 max_u = 0 num = 0 @@ -71,15 +73,14 @@ for line in f: else: value = "JOINING_TYPE_" + fields[2] print " %s, /* %s */" % (value, '; '.join(fields)) - print print "};" print - print "#define JOINING_TABLE_FIRST 0x%04X" % min_u print "#define JOINING_TABLE_LAST 0x%04X" % max_u print - +print "#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */" +print print "/* == End of generated table == */" occupancy = num * 100 / (max_u - min_u + 1) diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py index 72e6aaabf..0474a2795 100755 --- a/src/gen-indic-table.py +++ b/src/gen-indic-table.py @@ -74,9 +74,12 @@ for h in headers: for l in h: print " * %s" % (l.strip()) print " */" +print +print "#ifndef HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH" +print "#define HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH" +print # Shorten values -print short = [{ "Bindu": 'Bi', "Visarga": 'Vs', @@ -178,7 +181,6 @@ print "#define indic_offset_total %d" % offset print occupancy = used * 100. / total print "}; /* Table occupancy: %d%% */" % occupancy - print print "static INDIC_TABLE_ELEMENT_TYPE" print "get_indic_categories (hb_codepoint_t u)" @@ -190,7 +192,6 @@ for u,d in singles.items (): print " if (unlikely (u == 0x%04X)) return _(%s,%s);" % (u, short[0][d[0]], short[1][d[1]]) print " return _(x,x);" print "}" - print print "#undef _" for i in range (2): @@ -200,8 +201,8 @@ for i in range (2): for v in vv: print "#undef %s_%s" % \ (what_short[i], short[i][v]) - print +print "#endif /* HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH */" print print "/* == End of generated table == */" diff --git a/src/hb-ot-shape-complex-arabic-table.hh b/src/hb-ot-shape-complex-arabic-table.hh index e7ee226da..0ce0b3677 100644 --- a/src/hb-ot-shape-complex-arabic-table.hh +++ b/src/hb-ot-shape-complex-arabic-table.hh @@ -9,6 +9,10 @@ * # ArabicShaping-6.1.0.txt * # Date: 2011-04-15, 23:16:00 GMT [KW] */ + +#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH +#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH + static const uint8_t joining_table[] = { @@ -720,4 +724,6 @@ static const uint8_t joining_table[] = #define JOINING_TABLE_FIRST 0x0600 #define JOINING_TABLE_LAST 0x08AC +#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */ + /* == End of generated table == */ diff --git a/src/hb-ot-shape-complex-indic-table.hh b/src/hb-ot-shape-complex-indic-table.hh index 40a7ae7df..5b4b3445d 100644 --- a/src/hb-ot-shape-complex-indic-table.hh +++ b/src/hb-ot-shape-complex-indic-table.hh @@ -14,6 +14,9 @@ * # Date: 2011-06-14, 18:26:00 GMT [KW, LI] */ +#ifndef HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH +#define HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH + #define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 11 chars; Avagraha */ #define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 34 chars; Bindu */ @@ -864,5 +867,6 @@ get_indic_categories (hb_codepoint_t u) #undef IMC_TR #undef IMC_VOL +#endif /* HB_OT_SHAPE_COMPLEX_INDIC_TABLE_HH */ /* == End of generated table == */