1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-09 13:05:58 +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

@@ -30,10 +30,11 @@
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#include <assert.h>
#include <stdio.h>
#include "common.h"
#define SSET_F (IS_NUM_F | IS_UHX_F) /* SSET "0123456789ABCDEF" */
#define PLESS_SSET_F (IS_NUM_F | IS_UHX_F) /* SSET "0123456789ABCDEF" */
static const char PlessTable[16][8] = {
{'1','3','1','3','1','3','1','3'}, {'3','1','1','3','1','3','1','3'}, {'1','3','3','1','1','3','1','3'},
@@ -67,7 +68,7 @@ INTERNAL int zint_plessey(struct zint_symbol *symbol, unsigned char source[], in
if (length > 67) { /* 16 + 67 * 16 + 4 * 8 + 19 = 1139 */
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 370, "Input length %d too long (maximum 67)", length);
}
if ((i = z_not_sane(SSET_F, source, length))) {
if ((i = z_not_sane(PLESS_SSET_F, source, length))) {
return z_errtxtf(ZINT_ERROR_INVALID_DATA, symbol, 371,
"Invalid character at position %d in input (digits and \"ABCDEF\" only)", i);
}
@@ -334,6 +335,8 @@ INTERNAL int zint_msi_plessey(struct zint_symbol *symbol, unsigned char source[]
int no_checktext = 0;
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
assert(length > 0); /* Suppress clang-tidy-21 clang-analyzer-security.ArrayBound */
if (length > 92) { /* 3 (Start) + 92 * 12 + 3 * 12 + 4 (Stop) = 1147 */
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 372, "Input length %d too long (maximum 92)", length);
}