Ensure generated const data tables are hidden via "static" (#100)
authorPaul Smith <paul@mad-scientist.net>
Sun, 19 Feb 2017 22:33:25 +0000 (17:33 -0500)
committerSteven G. Johnson <stevenj@mit.edu>
Sun, 19 Feb 2017 22:33:25 +0000 (17:33 -0500)
data/data_generator.rb
utf8proc_data.c

index 97c9033a41904dd295f6e9c61610bfd6bacc4ac3..37a378071daa7f246238a10cab0d5715a5b26200 100644 (file)
@@ -340,7 +340,7 @@ for code in 0...0x110000
   end
 end
 
-$stdout << "const utf8proc_uint16_t utf8proc_sequences[] = {\n  "
+$stdout << "static const utf8proc_uint16_t utf8proc_sequences[] = {\n  "
 i = 0
 $int_array.each do |entry|
   i += 1
@@ -352,7 +352,7 @@ $int_array.each do |entry|
 end
 $stdout << "};\n\n"
 
-$stdout << "const utf8proc_uint16_t utf8proc_stage1table[] = {\n  "
+$stdout << "static const utf8proc_uint16_t utf8proc_stage1table[] = {\n  "
 i = 0
 stage1.each do |entry|
   i += 1
@@ -364,7 +364,7 @@ stage1.each do |entry|
 end
 $stdout << "};\n\n"
 
-$stdout << "const utf8proc_uint16_t utf8proc_stage2table[] = {\n  "
+$stdout << "static const utf8proc_uint16_t utf8proc_stage2table[] = {\n  "
 i = 0
 stage2.flatten.each do |entry|
   i += 1
@@ -376,7 +376,7 @@ stage2.flatten.each do |entry|
 end
 $stdout << "};\n\n"
 
-$stdout << "const utf8proc_property_t utf8proc_properties[] = {\n"
+$stdout << "static const utf8proc_property_t utf8proc_properties[] = {\n"
 $stdout << "  {0, 0, 0, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX,  false,false,false,false, 0, 0, UTF8PROC_BOUNDCLASS_OTHER},\n"
 properties.each { |line|
   $stdout << line
@@ -385,7 +385,7 @@ $stdout << "};\n\n"
 
 
 
-$stdout << "const utf8proc_uint16_t utf8proc_combinations[] = {\n  "
+$stdout << "static const utf8proc_uint16_t utf8proc_combinations[] = {\n  "
 i = 0
 comb1st_indicies.keys.each_index do |a|
   offset = 0
index d8a56bbd872e3d556705d254766eb540dcba5c97..3de2873ffd6fd514f50ceca6c7a5b77f9b8c36d0 100644 (file)
@@ -1,4 +1,4 @@
-const utf8proc_uint16_t utf8proc_sequences[] = {
+static const utf8proc_uint16_t utf8proc_sequences[] = {
   97, 98, 99, 100, 101, 102, 103, 
   104, 105, 106, 107, 108, 109, 110, 111, 
   112, 113, 114, 115, 116, 117, 118, 119, 
@@ -1176,7 +1176,7 @@ const utf8proc_uint16_t utf8proc_sequences[] = {
   56603, 55354, 56604, 55354, 56605, 55354, 56606, 55354, 
   56607, 55354, 56608, 55354, 56609, };
 
-const utf8proc_uint16_t utf8proc_stage1table[] = {
+static const utf8proc_uint16_t utf8proc_stage1table[] = {
   0, 256, 512, 768, 1024, 1280, 1536, 
   1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 
   3840, 4096, 4352, 4608, 4864, 5120, 5376, 5632, 
@@ -1723,7 +1723,7 @@ const utf8proc_uint16_t utf8proc_stage1table[] = {
   18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, 
   38656, };
 
-const utf8proc_uint16_t utf8proc_stage2table[] = {
+static const utf8proc_uint16_t utf8proc_stage2table[] = {
   1, 2, 2, 2, 2, 2, 2, 
   2, 2, 3, 4, 3, 5, 6, 2, 
   2, 2, 2, 2, 2, 2, 2, 2, 
@@ -6590,7 +6590,7 @@ const utf8proc_uint16_t utf8proc_stage2table[] = {
   3984, 3984, 3984, 3984, 3984, 3984, 3984, 0, 
   0, };
 
-const utf8proc_property_t utf8proc_properties[] = {
+static const utf8proc_property_t utf8proc_properties[] = {
   {0, 0, 0, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX,  false,false,false,false, 0, 0, UTF8PROC_BOUNDCLASS_OTHER},
   {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL},
   {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL},
@@ -13420,7 +13420,7 @@ const utf8proc_property_t utf8proc_properties[] = {
   {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER},
 };
 
-const utf8proc_uint16_t utf8proc_combinations[] = {
+static const utf8proc_uint16_t utf8proc_combinations[] = {
   0, 46, 192, 193, 194, 195, 196, 197, 0, 
   256, 258, 260, 550, 461, 0, 0, 512, 
   514, 0, 0, 0, 0, 0, 0, 0,