From 92296348268f265b4f06ada5c81d7ef4a249663b Mon Sep 17 00:00:00 2001 From: gitlost Date: Sun, 12 Sep 2021 23:37:44 +0100 Subject: [PATCH] Suppress some pedantic warnings, props codemonkey82 (#204) --- ChangeLog | 3 +++ backend/dllversion.c | 3 +++ backend/gs1.c | 10 +++++----- backend/tif.c | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2551d9f..cd18f01b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,11 +10,14 @@ Changes ------- - RMQR: add ECI support - CODE93: don't display check characters in HRT (as per standard Figure B1) +- GUI: separate out MAXICODE Structured Carrier Message fields Bugs ---- - GUI/CLI: fix dev version test - library.c: error_tag(): check error_number < ZINT_ERROR on WARN_FAIL_ALL +- vector.c: enforce minimum scale >= 0.1 and allow in GUI +- Suppress some pedantic warnings, props codemonkey82 (#204) Version 2.10.0 2021-08-14 diff --git a/backend/dllversion.c b/backend/dllversion.c index dbb89bc2..493859cd 100644 --- a/backend/dllversion.c +++ b/backend/dllversion.c @@ -29,4 +29,7 @@ HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi) return S_OK; } +#else +/* https://stackoverflow.com/a/26541331/664741 Suppresses gcc warning ISO C forbids an empty translation unit */ +typedef int make_iso_compilers_happy; #endif /* _WIN32 */ diff --git a/backend/gs1.c b/backend/gs1.c index c0cd2d75..e14a8643 100644 --- a/backend/gs1.c +++ b/backend/gs1.c @@ -68,12 +68,12 @@ static int numeric(const unsigned char *data, int data_len, int offset, int min, } /* GS1 General Specifications 21.0.1 Figure 7.9.5-1. GS1 AI encodable character reference values. - Also used to determine if character in set 82 */ + Also used to determine if character in set 82 - a value of 82 means not in */ static const char c82[] = { - 0, 1, -1, -1, 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, 27, 28, -1, /*1-@*/ + 0, 1, 82, 82, 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, 27, 28, 82, /*1-@*/ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, /*A-P*/ - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, -1, -1, -1, -1, 55, -1, /*Q-`*/ + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 82, 82, 82, 82, 55, 82, /*Q-`*/ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, /*a-p*/ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, /*q-z*/ }; @@ -93,7 +93,7 @@ static int cset82(const unsigned char *data, int data_len, int offset, int min, const unsigned char *de = d + (data_len > max ? max : data_len); for (; d < de; d++) { - if (*d < '!' || *d > 'z' || c82[*d - '!'] == -1) { + if (*d < '!' || *d > 'z' || c82[*d - '!'] == 82) { *p_err_no = 3; *p_err_posn = d - data + 1; sprintf(err_msg, "Invalid CSET 82 character '%c'", *d); diff --git a/backend/tif.c b/backend/tif.c index 9d099ff1..3227413b 100644 --- a/backend/tif.c +++ b/backend/tif.c @@ -94,7 +94,7 @@ INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf) int samples_per_pixel; int pixels_per_sample; unsigned char map[128]; - tiff_color_t color_map[256] = {0}; + tiff_color_t color_map[256] = {{0}}; unsigned char palette[32][5]; int color_map_size = 0; int extra_samples = 0;