1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-20 03:17:12 +00:00

general: suppress clang-tidy-21/22 warnings;

some code fiddling on affected files
manual: use new lua filter "lua-crossrefs.lua" hacked from
  https://github.com/rnwst/pandoc-lua-crossrefs as replacement for
  tablenos which broke with pandoc 2.8.2 (get nicer output anyway);
  fix "excode39.svg" data $ -> # to avoid shell processing;
  document `ZBarcode_HaveGS1SyntaxEngine()`
This commit is contained in:
gitlost
2025-10-08 12:21:29 +01:00
parent d413255c93
commit a3cca33f32
30 changed files with 1645 additions and 1080 deletions

View File

@@ -204,7 +204,7 @@ static int c1_look_ahead_test(const unsigned char source[], const int length, co
for (sp = position; sp < length; sp++) {
const unsigned char c = source[sp];
const int is_extended = c & 0x80;
const int is_extended = !z_isascii(c);
/* Step L */
if (z_isdigit(c)) {
@@ -456,7 +456,7 @@ static int c1_c40text_cnt(const int current_mode, const int gs1, unsigned char i
return 2;
}
cnt = 1;
if (input & 0x80) {
if (!z_isascii(input)) {
cnt += 2;
input -= 128;
}
@@ -646,7 +646,7 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], int len
if (next_mode == C1_ASCII) {
if (debug_print) printf("ASC(%d) ", source[sp]);
if (source[sp] & 0x80) {
if (!z_isascii(source[sp])) {
/* Step B7 */
target[tp++] = 235; /* FNC4 (Upper Shift) */
target[tp++] = (source[sp] - 128) + 1;
@@ -700,9 +700,10 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], int len
}
if (debug_print) fputs(current_mode == C1_C40 ? "C40 " : "TEXT ", stdout);
if (source[sp] & 0x80) {
if (!z_isascii(source[sp])) {
cte_buffer[cte_p++] = 1; /* Shift 2 */
cte_buffer[cte_p++] = 30; /* FNC4 (Upper Shift) */
assert(source[sp] >= 128); /* Suppress clang-tidy-21 clang-analyzer-security.ArrayBound */
if (ct_shift[source[sp] - 128]) {
cte_buffer[cte_p++] = ct_shift[source[sp] - 128] - 1;
}
@@ -900,7 +901,7 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], int len
if (z_is_twodigits(source, length, sp)) {
target[tp++] = z_to_int(source + sp, 2) + 130;
sp++;
} else if (source[sp] & 0x80) {
} else if (!z_isascii(source[sp])) {
target[tp++] = 235; /* FNC4 (Upper Shift) */
target[tp++] = (source[sp] - 128) + 1;
} else if (gs1 && source[sp] == '\x1D') {