From 1ca01e93225aa2a12ec1cd7434540fcea0505664 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Wed, 9 Aug 2017 09:13:37 +0100 Subject: [PATCH] Make data types for tables consistent across symbologies ..and reduce library binary size slightly --- backend/aztec.h | 14 ++++++------- backend/code1.h | 26 +++++++++++------------ backend/code49.h | 6 +++--- backend/composite.h | 6 +++--- backend/dmatrix.h | 26 +++++++++++------------ backend/dotcode.c | 2 +- backend/font.h | 4 ++-- backend/gridmtx.h | 14 ++++++------- backend/hanxin.h | 6 +++--- backend/imail.c | 2 +- backend/maxicode.h | 4 ++-- backend/pdf417.c | 6 +++--- backend/pdf417.h | 4 ++-- backend/qr.h | 26 +++++++++++------------ backend/rss.h | 50 ++++++++++++++++++++++----------------------- 15 files changed, 98 insertions(+), 98 deletions(-) diff --git a/backend/aztec.h b/backend/aztec.h index c8efc249..87605685 100644 --- a/backend/aztec.h +++ b/backend/aztec.h @@ -68,7 +68,7 @@ static const unsigned short int CompactAztecMap[] = { 559, 557, 555, 553, 551, 549, 547, 545, 543, 541, 539, 537, 535, 533, 531, 529, 527, 525, 523, 521, 519, 517, 515, 513, 511, 508, 509 }; -static const int AztecSymbolChar[128] = { +static const char AztecSymbolChar[128] = { /* From Table 2 */ 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 15, 16, 17, 18, 19, 1, 6, 7, 8, 9, 10, 11, 12, @@ -119,27 +119,27 @@ static const unsigned short int Aztec50DataSizes[32] = { 8844, 9384, 9948 }; -static const int AztecCompact10DataSizes [4] = { +static const unsigned short int AztecCompact10DataSizes [4] = { 78, 198, 336, 520 }; -static const int AztecCompact23DataSizes [4] = { +static const unsigned short int AztecCompact23DataSizes [4] = { 66, 168, 288, 440 }; -static const int AztecCompact36DataSizes [4] = { +static const unsigned short int AztecCompact36DataSizes [4] = { 48, 138, 232, 360 }; -static const int AztecCompact50DataSizes [4] = { +static const unsigned short int AztecCompact50DataSizes [4] = { 36, 102, 176, 280 }; -static const int AztecOffset[32] = { +static const char AztecOffset[32] = { 66, 64, 62, 60, 57, 55, 53, 51, 49, 47, 45, 42, 40, 38, 36, 34, 32, 30, 28, 25, 23, 21, 19, 17, 15, 13, 10, 8, 6, 4, 2, 0 }; -static const int AztecCompactOffset[4] = { +static const char AztecCompactOffset[4] = { 6, 4, 2, 0 }; diff --git a/backend/code1.h b/backend/code1.h index af27016b..e517544f 100644 --- a/backend/code1.h +++ b/backend/code1.h @@ -30,67 +30,67 @@ SUCH DAMAGE. */ -static const int c40_shift[] = { +static const char c40_shift[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; -static const int c40_value[] = { +static const char c40_value[] = { 0, 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, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 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, 22, 23, 24, 25, 26, 0, 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 }; -static const int text_shift[] = { +static const char text_shift[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3 }; -static const int text_value[] = { +static const char text_value[] = { 0, 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, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 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, 22, 23, 24, 25, 26, 0, 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, 27, 28, 29, 30, 31 }; -static const int c1_height[] = { +static const unsigned short int c1_height[] = { 16, 22, 28, 40, 52, 70, 104, 148 }; -static const int c1_width[] = { +static const unsigned short int c1_width[] = { 18, 22, 32, 42, 54, 76, 98, 134 }; -static const int c1_data_length[] = { +static const unsigned short int c1_data_length[] = { 10, 19, 44, 91, 182, 370, 732, 1480 }; -static const int c1_ecc_length[] = { +static const unsigned short int c1_ecc_length[] = { 10, 16, 26, 44, 70, 140, 280, 560 }; -static const int c1_blocks[] = { +static const unsigned short int c1_blocks[] = { 1, 1, 1, 1, 1, 2, 4, 8 }; -static const int c1_data_blocks[] = { +static const unsigned short int c1_data_blocks[] = { 10, 19, 44, 91, 182, 185, 183, 185 }; -static const int c1_ecc_blocks[] = { +static const unsigned short int c1_ecc_blocks[] = { 10, 16, 26, 44, 70, 70, 70, 70 }; -static const int c1_grid_width[] = { +static const unsigned short int c1_grid_width[] = { 4, 5, 7, 9, 12, 17, 22, 30 }; -static const int c1_grid_height[] = { +static const unsigned short int c1_grid_height[] = { 5, 7, 10, 15, 21, 30, 46, 68 }; diff --git a/backend/code49.h b/backend/code49.h index 2c654c7a..01dec462 100644 --- a/backend/code49.h +++ b/backend/code49.h @@ -47,17 +47,17 @@ static const char *c49_table7[128] = { }; /* Table 5: Check Character Weighting Values */ -static const int c49_x_weight[] = { +static const char c49_x_weight[] = { 1, 9, 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43, 39, 11, 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10 }; -static const int c49_y_weight[] = { +static const char c49_y_weight[] = { 9, 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43, 39, 11, 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10, 24 }; -static const int c49_z_weight[] = { +static const char c49_z_weight[] = { 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43, 39, 11, 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10, 24, 30 }; diff --git a/backend/composite.h b/backend/composite.h index ac86ee0b..e0106f44 100644 --- a/backend/composite.h +++ b/backend/composite.h @@ -38,7 +38,7 @@ #define ALPHA_OR_ISO 121 /* CC-A component coefficients from ISO/IEC 24728:2006 Annex F */ -static const int ccaCoeffs[30] = { +static const unsigned short int ccaCoeffs[30] = { /* k = 4 */ 522, 568, 723, 809, @@ -56,14 +56,14 @@ static const int ccaCoeffs[30] = { }; /* rows, error codewords, k-offset of valid CC-A sizes from ISO/IEC 24723:2006 Table 9 */ -static const int ccaVariants[51] = { +static const char ccaVariants[51] = { 5, 6, 7, 8, 9, 10, 12, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 4, 4, 5, 5, 6, 6, 7, 4, 5, 6, 7, 7, 4, 5, 6, 7, 8, 0, 0, 4, 4, 9, 9, 15, 0, 4, 9, 15, 15, 0, 4, 9, 15, 22 }; /* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24723:2006 tables 10 and 11 */ -static const int aRAPTable[68] = { +static const char aRAPTable[68] = { 39, 1, 32, 8, 14, 43, 20, 11, 1, 5, 15, 21, 40, 43, 46, 34, 29, 0, 0, 0, 0, 0, 0, 0, 43, 33, 37, 47, 1, 20, 23, 26, 14, 9, 19, 33, 12, 40, 46, 23, 52, 23, 13, 17, 27, 33, 52, 3, 6, 46, 41, diff --git a/backend/dmatrix.h b/backend/dmatrix.h index 17ab21d5..7d1f6415 100644 --- a/backend/dmatrix.h +++ b/backend/dmatrix.h @@ -60,28 +60,28 @@ extern int data_matrix_200(struct zint_symbol *symbol, const unsigned char sourc #define DM_EDIFACT 5 #define DM_BASE256 6 -static const int c40_shift[] = { +static const char c40_shift[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; -static const int c40_value[] = { +static const char c40_value[] = { 0, 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, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 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, 22, 23, 24, 25, 26, 0, 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 }; -static const int text_shift[] = { +static const char text_shift[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3 }; -static const int text_value[] = { +static const char text_value[] = { 0, 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, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 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, @@ -93,7 +93,7 @@ static const int text_value[] = { // The last comment value is the total data codewords value. // The index of this array is the --vers parameter value -1 and is given as forst comment value -static const int intsymbol[] = { +static const unsigned short int intsymbol[] = { 0, /* 1: 10x10 , 3*/ 1, /* 2: 12x12 , 5*/ 3, /* 3: 14x14 , 8*/ 5, /* 4: 16x16 , 12*/ 7, /* 5: 18x18 , 18*/ 9, /* 6: 20x20 , 22*/ 12, /* 7: 22x22 , 30*/ 14, /* 8: 24x24 , 36*/ 16, /* 9: 26x26 , 44*/ 18, /* 10: 32x32 , 62*/ 21, /* 11: 36x36 , 86*/ 24, /* 12: 40x40 ,114*/ @@ -115,7 +115,7 @@ static const int intsymbol[] = { // Is the current code a DMRE code ? // This is the case, if intsymbol index >= 30 -static const int isDMRE[] = { +static const char isDMRE[] = { /* 0*/ 0, /* 10x10, 3 */ 0, /* 12x12 , 5 */ 0, /* 8x18 , 5 */ 0, /* 14x14 , 8 */ /* 4*/ 0, /* 8x32 ,10 */ 0, /* 16x16 ,12 */ 0, /* 12x26 ,16 */ 0, /* 18x18 ,18 */ /* 8*/ 1, /* 8x48 ,18 */ 0, /* 20x20 ,22 */ 0, /* 12x36 ,22 */ 1, /* 8x64 ,24 */ @@ -130,7 +130,7 @@ static const int isDMRE[] = { // Horizontal matrix size -static const int matrixH[] = { +static const unsigned short int matrixH[] = { /* 0*/ 10, /* 10x10 , 3 */ 12, /* 12x12 , 5 */ 8, /* 8x18 , 5 */ 14, /* 14x14 , 8 */ /* 4*/ 8, /* 8x32 ,10 */ 16, /* 16x16 ,12 */ 12, /* 12x26 ,16 */ 18, /* 18x18 ,18 */ /* 8*/ 8, /* 8x48 ,18 */ 20, /* 20x20 ,22 */ 12, /* 12x36 ,22 */ 8, /* 8x64 ,24 */ @@ -145,7 +145,7 @@ static const int matrixH[] = { // Vertical matrix sizes -static const int matrixW[] = { +static const unsigned short int matrixW[] = { /* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */ /* 4*/ 32, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */ /* 8*/ 48, /* 8x48 */ 20, /* 20x20 */ 36, /* 12x36 */ 64, /* 8x64 */ @@ -160,7 +160,7 @@ static const int matrixW[] = { // Horizontal submodule size (including subfinder) -static const int matrixFH[] = { +static const unsigned short int matrixFH[] = { /* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 8, /* 8x18 */ 14, /* 14x14 */ /* 4*/ 8, /* 8x32 */ 16, /* 16x16 */ 12, /* 12x26 */ 18, /* 18x18 */ /* 8*/ 8, /* 8x48 */ 20, /* 20x20 */ 12, /* 12x36 */ 8, /* 8x64 */ @@ -175,7 +175,7 @@ static const int matrixFH[] = { // Vertical submodule size (including subfinder) -static const int matrixFW[] = { +static const unsigned short int matrixFW[] = { /* 0*/ 10, /* 10x10 */ 12, /* 12x12 */ 18, /* 8x18 */ 14, /* 14x14 */ /* 4*/ 16, /* 8x32 */ 16, /* 16x16 */ 26, /* 12x26 */ 18, /* 18x18 */ /* 8*/ 24, /* 8x48 */ 20, /* 20x20 */ 18, /* 12x36 */ 16, /* 8x64 */ @@ -190,7 +190,7 @@ static const int matrixFW[] = { // Total Data Codewords -static const int matrixbytes[] = { +static const unsigned short int matrixbytes[] = { /* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */ /* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */ /* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */ @@ -205,7 +205,7 @@ static const int matrixbytes[] = { // Data Codewords per RS-Block -static const int matrixdatablock[] = { +static const unsigned short int matrixdatablock[] = { /* 0*/ 3, /* 10x10 */ 5, /* 12x12 */ 5, /* 8x18 */ 8, /* 14x14 */ /* 4*/ 10, /* 8x32 */ 12, /* 16x16 */ 16, /* 12x26 */ 18, /* 18x18 */ /* 8*/ 18, /* 8x48 */ 22, /* 20x20 */ 22, /* 12x36 */ 24, /* 8x64 */ @@ -220,7 +220,7 @@ static const int matrixdatablock[] = { // ECC Codewords per RS-Block -static const int matrixrsblock[] = { +static const unsigned short int matrixrsblock[] = { /* 0*/ 5, /* 10x10 */ 7, /* 12x12 */ 7, /* 8x18 */ 10, /* 14x14 */ /* 4*/ 11, /* 8x32 */ 12, /* 16x16 */ 14, /* 12x26 */ 14, /* 18x18 */ /* 8*/ 15, /* 8x48 */ 18, /* 20x20 */ 18, /* 12x36 */ 18, /* 8x64 */ diff --git a/backend/dotcode.c b/backend/dotcode.c index 33a34459..ce2219a4 100644 --- a/backend/dotcode.c +++ b/backend/dotcode.c @@ -51,7 +51,7 @@ #define PM 3 /* DotCode symbol character dot patterns, from Annex C */ -static const int dot_patterns[113] = { +static const unsigned short int dot_patterns[113] = { 0x155, 0x0ab, 0x0ad, 0x0b5, 0x0d5, 0x156, 0x15a, 0x16a, 0x1aa, 0x0ae, 0x0b6, 0x0ba, 0x0d6, 0x0da, 0x0ea, 0x12b, 0x12d, 0x135, 0x14b, 0x14d, 0x153, 0x159, 0x165, 0x169, 0x195, 0x1a5, 0x1a9, 0x057, 0x05b, 0x05d, diff --git a/backend/font.h b/backend/font.h index 01210123..021eface 100644 --- a/backend/font.h +++ b/backend/font.h @@ -30,7 +30,7 @@ SUCH DAMAGE. */ -static const int ascii_font[] = { +static const char ascii_font[] = { /* Each character is 7 x 14 pixels */ 0, 0, 8, 8, 8, 8, 8, 8, 8, 0, 8, 8, 0, 0, /* ! */ 0, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* " */ @@ -224,7 +224,7 @@ static const int ascii_font[] = { 0, 0, 0, 36, 0, 66, 66, 34, 36, 20, 28, 8, 72, 48, /* ΓΏ */ }; -static const int small_font[] = { +static const char small_font[] = { /* Each character is 5 x 9 pixels */ 0, 2, 2, 2, 2, 0, 2, 0, 0, /* ! */ 0, 5, 5, 5, 0, 0, 0, 0, 0, /* " */ diff --git a/backend/gridmtx.h b/backend/gridmtx.h index 9c47425a..51534889 100644 --- a/backend/gridmtx.h +++ b/backend/gridmtx.h @@ -47,15 +47,15 @@ static const char shift_set[] = { ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~' }; -static const int gm_recommend_cw[] = { +static const unsigned short int gm_recommend_cw[] = { 9, 30, 59, 114, 170, 237, 315, 405, 506, 618, 741, 875, 1021 }; -static const int gm_max_cw[] = { +static const unsigned short int gm_max_cw[] = { 11, 40, 79, 146, 218, 305, 405, 521, 650, 794, 953, 1125, 1313 }; -static const int gm_data_codewords[] = { +static const unsigned short int gm_data_codewords[] = { 0, 15, 13, 11, 9, 45, 40, 35, 30, 25, 89, 79, 69, 59, 49, @@ -71,20 +71,20 @@ static const int gm_data_codewords[] = { 1313, 1167, 1021, 875, 729 }; -static const int gm_n1[] = { +static const char gm_n1[] = { 18, 50, 98, 81, 121, 113, 113, 116, 121, 126, 118, 125, 122 }; -static const int gm_b1[] = { +static const char gm_b1[] = { 1, 1, 1, 2, 2, 2, 2, 3, 2, 7, 5, 10, 6 }; -static const int gm_b2[] = { +static const char gm_b2[] = { 0, 0, 0, 0, 0, 1, 2, 2, 4, 0, 4, 0, 6 }; /* Values from table A.1 */ -static const int gm_ebeb[] = { +static const char gm_ebeb[] = { /* E1 B3 E2 B4 */ 0, 0, 0, 0, // version 1 3, 1, 0, 0, diff --git a/backend/hanxin.h b/backend/hanxin.h index 4070b85d..1ad46851 100644 --- a/backend/hanxin.h +++ b/backend/hanxin.h @@ -80,7 +80,7 @@ static const unsigned short int hx_data_codewords_L4[] = { }; /* Value 'k' from Annex A */ -static const int hx_module_k[] = { +static const char hx_module_k[] = { 0, 0, 0, 14, 16, 16, 17, 18, 19, 20, 14, 15, 16, 16, 17, 17, 18, 19, 20, 20, 21, 16, 17, 17, 18, 18, 19, 19, 20, 20, @@ -93,7 +93,7 @@ static const int hx_module_k[] = { }; /* Value 'r' from Annex A */ -static const int hx_module_r[] = { +static const char hx_module_r[] = { 0, 0, 0, 15, 15, 17, 18, 19, 20, 21, 15, 15, 15, 17, 17, 19, 19, 19, 19, 21, 21, 17, 16, 18, 17, 19, 18, 20, 19, 21, @@ -106,7 +106,7 @@ static const int hx_module_r[] = { }; /* Value of 'm' from Annex A */ -static const int hx_module_m[] = { +static const char hx_module_m[] = { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, diff --git a/backend/imail.c b/backend/imail.c index c4e2c10b..54892825 100644 --- a/backend/imail.c +++ b/backend/imail.c @@ -188,7 +188,7 @@ static const unsigned short AppxD_II[78] = { 0x0801, 0x1002, 0x1001, 0x0802, 0x0404, 0x0208, 0x0110, 0x00A0 }; -static const int AppxD_IV[130] = { +static const unsigned short int AppxD_IV[130] = { /* Appendix D Table IV - Bar-to-Character Mapping (reverse lookup) */ 67, 6, 78, 16, 86, 95, 34, 40, 45, 113, 117, 121, 62, 87, 18, 104, 41, 76, 57, 119, 115, 72, 97, 2, 127, 26, 105, 35, 122, 52, 114, 7, 24, 82, 68, 63, 94, 44, 77, 112, 70, 100, 39, 30, 107, diff --git a/backend/maxicode.h b/backend/maxicode.h index 7a44b62d..2d224597 100644 --- a/backend/maxicode.h +++ b/backend/maxicode.h @@ -67,7 +67,7 @@ static const unsigned short int MaxiGrid[] = { 738, 737, 744, 743, 750, 749, 756, 755, 762, 761, 768, 767, 774, 773, 780, 779, 786, 785, 792, 791, 798, 797, 804, 803, 810, 809, 816, 815, 864, 863 }; -static const int maxiCodeSet[256] = { +static const char maxiCodeSet[256] = { /* from Appendix A - ASCII character to Code Set (e.g. 2 = Set B) */ /* set 0 refers to special characters that fit into more than one set (e.g. GS) */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, @@ -85,7 +85,7 @@ static const int maxiCodeSet[256] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; -static const int maxiSymbolChar[256] = { +static const char maxiSymbolChar[256] = { /* from Appendix A - ASCII character to symbol value */ 0, 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, 30, 28, 29, 30, 35, 32, 53, 34, 35, 36, 37, 38, 39, diff --git a/backend/pdf417.c b/backend/pdf417.c index 8e9548c8..ca64578c 100644 --- a/backend/pdf417.c +++ b/backend/pdf417.c @@ -62,14 +62,14 @@ /* text mode processing tables */ -static const int asciix[95] = { +static const char asciix[95] = { 7, 8, 8, 4, 12, 4, 4, 8, 8, 8, 12, 4, 12, 12, 12, 12, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 12, 8, 8, 4, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 4, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, 8, 8, 8 }; -static const int asciiy[95] = { +static const char asciiy[95] = { 26, 10, 20, 15, 18, 21, 10, 28, 23, 24, 22, 20, 13, 16, 17, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 0, 1, 23, 2, 25, 3, 0, 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, 4, 5, 6, 24, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @@ -78,7 +78,7 @@ static const int asciiy[95] = { /* Automatic sizing table */ -static const int MicroAutosize[56] = { +static const char MicroAutosize[56] = { 4, 6, 7, 8, 10, 12, 13, 14, 16, 18, 19, 20, 24, 29, 30, 33, 34, 37, 39, 46, 54, 58, 70, 72, 82, 90, 108, 126, 1, 14, 2, 7, 3, 25, 8, 16, 5, 17, 9, 6, 10, 11, 28, 12, 19, 13, 29, 20, 30, 21, 22, 31, 23, 32, 33, 34 }; diff --git a/backend/pdf417.h b/backend/pdf417.h index 29afac0c..2c2f5517 100644 --- a/backend/pdf417.h +++ b/backend/pdf417.h @@ -475,7 +475,7 @@ static const unsigned short int Microcoeffs[344] = { }; /* rows, columns, error codewords, k-offset of valid MicroPDF417 sizes from ISO/IEC 24728:2006 */ -static const int MicroVariants[170] ={ +static const unsigned short int MicroVariants[170] ={ 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 11, 14, 17, 20, 24, 28, 8, 11, 14, 17, 20, 23, 26, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44, 4, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 11, 13, 15, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50, 8, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50, @@ -484,7 +484,7 @@ static const int MicroVariants[170] ={ /* rows, columns, error codewords, k-offset */ /* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */ -static const int RAPTable[136] ={ +static const char RAPTable[136] ={ 1, 8, 36, 19, 9, 25, 1, 1, 8, 36, 19, 9, 27, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 47, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 19, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 9, 8, 36, 19, 17, 33, 1, 9, 8, 36, 19, 17, 35, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49, 43, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49, diff --git a/backend/qr.h b/backend/qr.h index d1c248f5..c5a23c9e 100644 --- a/backend/qr.h +++ b/backend/qr.h @@ -39,70 +39,70 @@ #define RHODIUM "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:" /* From ISO/IEC 18004:2006 Table 7 */ -static int qr_data_codewords_L[] = { +static const unsigned short int qr_data_codewords_L[] = { 19, 34, 55, 80, 108, 136, 156, 194, 232, 274, 324, 370, 428, 461, 523, 589, 647, 721, 795, 861, 932, 1006, 1094, 1174, 1276, 1370, 1468, 1531, 1631, 1735, 1843, 1955, 2071, 2191, 2306, 2434, 2566, 2702, 2812, 2956 }; -static int qr_data_codewords_M[] = { +static const unsigned short int qr_data_codewords_M[] = { 16, 28, 44, 64, 86, 108, 124, 154, 182, 216, 254, 290, 334, 365, 415, 453, 507, 563, 627, 669, 714, 782, 860, 914, 1000, 1062, 1128, 1193, 1267, 1373, 1455, 1541, 1631, 1725, 1812, 1914, 1992, 2102, 2216, 2334 }; -static int qr_data_codewords_Q[] = { +static const unsigned short int qr_data_codewords_Q[] = { 13, 22, 34, 48, 62, 76, 88, 110, 132, 154, 180, 206, 244, 261, 295, 325, 367, 397, 445, 485, 512, 568, 614, 664, 718, 754, 808, 871, 911, 985, 1033, 1115, 1171, 1231, 1286, 1354, 1426, 1502, 1582, 1666 }; -static int qr_data_codewords_H[] = { +static const unsigned short int qr_data_codewords_H[] = { 9, 16, 26, 36, 46, 60, 66, 86, 100, 122, 140, 158, 180, 197, 223, 253, 283, 313, 341, 385, 406, 442, 464, 514, 538, 596, 628, 661, 701, 745, 793, 845, 901, 961, 986, 1054, 1096, 1142, 1222, 1276 }; -static int qr_total_codewords[] = { +static const unsigned short int qr_total_codewords[] = { 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706 }; -static int qr_blocks_L[] = { +static const char qr_blocks_L[] = { 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25 }; -static int qr_blocks_M[] = { +static const char qr_blocks_M[] = { 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49 }; -static int qr_blocks_Q[] = { +static const char qr_blocks_Q[] = { 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68 }; -static int qr_blocks_H[] = { +static const char qr_blocks_H[] = { 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81 }; -static int qr_sizes[] = { +static const unsigned short int qr_sizes[] = { 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177 }; -static int micro_qr_sizes[] = { +static const char micro_qr_sizes[] = { 11, 13, 15, 17 }; -static int qr_align_loopsize[] = { +static const char qr_align_loopsize[] = { 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7 }; -static int qr_table_e1[] = { +static const unsigned short int qr_table_e1[] = { 6, 18, 0, 0, 0, 0, 0, 6, 22, 0, 0, 0, 0, 0, 6, 26, 0, 0, 0, 0, 0, diff --git a/backend/rss.h b/backend/rss.h index 4fad12a7..a09f9a4d 100644 --- a/backend/rss.h +++ b/backend/rss.h @@ -38,32 +38,32 @@ #define ALPHA_OR_ISO 121 /* RSS-14 Tables */ -static int g_sum_table[9] = { +static const unsigned short int g_sum_table[9] = { 0, 161, 961, 2015, 2715, 0, 336, 1036, 1516 }; -static int t_table[9] = { +static const char t_table[9] = { 1, 10, 34, 70, 126, 4, 20, 48, 81 }; -static int modules_odd[9] = { +static const char modules_odd[9] = { 12, 10, 8, 6, 4, 5, 7, 9, 11 }; -static int modules_even[9] = { +static const char modules_even[9] = { 4, 6, 8, 10, 12, 10, 8, 6, 4 }; -static int widest_odd[9] = { +static const char widest_odd[9] = { 8, 6, 4, 3, 1, 2, 4, 6, 8 }; -static int widest_even[9] = { +static const char widest_even[9] = { 1, 3, 5, 6, 8, 7, 5, 3, 1 }; static int widths[8]; -static int finder_pattern[45] = { +static const char finder_pattern[45] = { 3, 8, 2, 1, 1, 3, 5, 5, 1, 1, 3, 3, 7, 1, 1, @@ -75,7 +75,7 @@ static int finder_pattern[45] = { 1, 3, 9, 1, 1 }; -static int checksum_weight[32] = { +static const char checksum_weight[32] = { /* Table 5 */ 1, 3, 9, 27, 2, 6, 18, 54, 4, 12, 36, 29, 8, 24, 72, 58, @@ -84,33 +84,33 @@ static int checksum_weight[32] = { }; /* RSS Limited Tables */ -static int t_even_ltd[7] = { +static const unsigned short int t_even_ltd[7] = { 28, 728, 6454, 203, 2408, 1, 16632 }; -static int modules_odd_ltd[7] = { +static const char modules_odd_ltd[7] = { 17, 13, 9, 15, 11, 19, 7 }; -static int modules_even_ltd[7] = { +static const char modules_even_ltd[7] = { 9, 13, 17, 11, 15, 7, 19 }; -static int widest_odd_ltd[7] = { +static const char widest_odd_ltd[7] = { 6, 5, 3, 5, 4, 8, 1 }; -static int widest_even_ltd[7] = { +static const char widest_even_ltd[7] = { 3, 4, 6, 4, 5, 1, 8 }; -static int checksum_weight_ltd[28] = { +static const char checksum_weight_ltd[28] = { /* Table 7 */ 1, 3, 9, 27, 81, 65, 17, 51, 64, 14, 42, 37, 22, 66, 20, 60, 2, 6, 18, 54, 73, 41, 34, 13, 39, 28, 84, 74 }; -static int finder_pattern_ltd[1246] = { +static const char finder_pattern_ltd[1246] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, @@ -203,31 +203,31 @@ static int finder_pattern_ltd[1246] = { }; /* RSS Expanded Tables */ -static int g_sum_exp[5] = { +static const unsigned short int g_sum_exp[5] = { 0, 348, 1388, 2948, 3988 }; -static int t_even_exp[5] = { +static const unsigned short int t_even_exp[5] = { 4, 20, 52, 104, 204 }; -static int modules_odd_exp[5] = { +static const char modules_odd_exp[5] = { 12, 10, 8, 6, 4 }; -static int modules_even_exp[5] = { +static const char modules_even_exp[5] = { 5, 7, 9, 11, 13 }; -static int widest_odd_exp[5] = { +static const char widest_odd_exp[5] = { 7, 5, 4, 3, 1 }; -static int widest_even_exp[5] = { +static const char widest_even_exp[5] = { 2, 4, 5, 6, 8 }; -static int checksum_weight_exp[184] = { +static const unsigned short int checksum_weight_exp[184] = { /* Table 14 */ 1, 3, 9, 27, 81, 32, 96, 77, 20, 60, 180, 118, 143, 7, 21, 63, @@ -254,7 +254,7 @@ static int checksum_weight_exp[184] = { 45, 135, 194, 160, 58, 174, 100, 89 }; -static int finder_pattern_exp[60] = { +static const char finder_pattern_exp[60] = { /* Table 15 */ 1, 8, 4, 1, 1, 1, 1, 4, 8, 1, @@ -270,7 +270,7 @@ static int finder_pattern_exp[60] = { 1, 1, 9, 2, 2 }; -static int finder_sequence[198] = { +static const char finder_sequence[198] = { /* Table 16 */ 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, @@ -284,7 +284,7 @@ static int finder_sequence[198] = { 1, 2, 3, 4, 5, 8, 7, 10, 9, 12, 11 }; -static int weight_rows[210] = { +static const char weight_rows[210] = { 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 3, 4, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,