1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-09 13:05:58 +00:00

general: prefix all INTERNAL funcs/tables with zint_, except

those in "backend/common.h", which are prefixed by `z_` - makes
  symbol clashes more unlikely when zint is statically linked
  (ticket #337, props Ulrich Becker)
DOTCODE: fix padding allowance (10 -> 52 - probable max 35) to
  cover cases with large no. of columns requested and little data,
  to prevent `codeword_array` buffer overflow
AZTEC/CODEONE: some code fiddling
general_field: prefix defines with `GF_`, shorten static funcs
  prefix `general_field_` -> `gf_`
This commit is contained in:
gitlost
2025-08-26 23:48:00 +01:00
parent e18b047a45
commit 39380d6767
106 changed files with 4477 additions and 4360 deletions

View File

@@ -32,7 +32,7 @@
#include "testcommon.h"
#include <sys/stat.h>
INTERNAL int bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf);
INTERNAL int zint_bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf);
static void test_pixel_plot(const testCtx *const p_ctx) {
int debug = p_ctx->debug;
@@ -84,7 +84,7 @@ static void test_pixel_plot(const testCtx *const p_ctx) {
symbol->debug |= debug;
size = data[i].width * data[i].height;
assert_nonzero(size < (int) sizeof(data_buf), "i:%d bmp_pixel_plot size %d < sizeof(data_buf) %d\n",
assert_nonzero(size < (int) sizeof(data_buf), "i:%d zint_bmp_pixel_plot size %d < sizeof(data_buf) %d\n",
i, size, (int) sizeof(data_buf));
if (data[i].repeat) {
@@ -92,7 +92,7 @@ static void test_pixel_plot(const testCtx *const p_ctx) {
} else {
strcpy(data_buf, data[i].pattern);
}
assert_equal(size, (int) strlen(data_buf), "i:%d bmp_pixel_plot size %d != strlen(data_buf) %d\n",
assert_equal(size, (int) strlen(data_buf), "i:%d zint_bmp_pixel_plot size %d != strlen(data_buf) %d\n",
i, size, (int) strlen(data_buf));
if (*data_buf > '9') {
@@ -101,8 +101,8 @@ static void test_pixel_plot(const testCtx *const p_ctx) {
symbol->bitmap = (unsigned char *) data_buf;
ret = bmp_pixel_plot(symbol, TCU(data_buf));
assert_equal(ret, data[i].ret, "i:%d bmp_pixel_plot ret %d != %d (%s)\n",
ret = zint_bmp_pixel_plot(symbol, TCU(data_buf));
assert_equal(ret, data[i].ret, "i:%d zint_bmp_pixel_plot ret %d != %d (%s)\n",
i, ret, data[i].ret, symbol->errtxt);
if (ret < ZINT_ERROR) {
@@ -286,13 +286,13 @@ static void test_outfile(const testCtx *const p_ctx) {
(void) testUtilRmROFile(symbol.outfile); /* In case lying around from previous fail */
assert_nonzero(testUtilCreateROFile(symbol.outfile),
"bmp_pixel_plot testUtilCreateROFile(%s) fail (%d: %s)\n",
"zint_bmp_pixel_plot testUtilCreateROFile(%s) fail (%d: %s)\n",
symbol.outfile, errno, strerror(errno));
ret = bmp_pixel_plot(&symbol, data);
assert_equal(ret, ZINT_ERROR_FILE_ACCESS, "bmp_pixel_plot ret %d != ZINT_ERROR_FILE_ACCESS (%d) (%s)\n",
ret = zint_bmp_pixel_plot(&symbol, data);
assert_equal(ret, ZINT_ERROR_FILE_ACCESS, "zint_bmp_pixel_plot ret %d != ZINT_ERROR_FILE_ACCESS (%d) (%s)\n",
ret, ZINT_ERROR_FILE_ACCESS, symbol.errtxt);
assert_zero(testUtilRmROFile(symbol.outfile), "bmp_pixel_plot testUtilRmROFile(%s) != 0 (%d: %s)\n",
assert_zero(testUtilRmROFile(symbol.outfile), "zint_bmp_pixel_plot testUtilRmROFile(%s) != 0 (%d: %s)\n",
symbol.outfile, errno, strerror(errno));
assert_zero(strncmp(symbol.errtxt, expected_errtxt, sizeof(expected_errtxt) - 1), "strncmp(%s, %s) != 0\n",
symbol.errtxt, expected_errtxt);
@@ -300,9 +300,9 @@ static void test_outfile(const testCtx *const p_ctx) {
symbol.output_options |= BARCODE_STDOUT;
ret = bmp_pixel_plot(&symbol, data);
ret = zint_bmp_pixel_plot(&symbol, data);
printf(" - ignore (BMP to stdout)\n"); fflush(stdout);
assert_zero(ret, "bmp_pixel_plot ret %d != 0 (%s)\n", ret, symbol.errtxt);
assert_zero(ret, "zint_bmp_pixel_plot ret %d != 0 (%s)\n", ret, symbol.errtxt);
testFinish();
}