zint/backend
Schaich e7947dc9a4 Merge String Constant
The `CALCIUM` "name" is a macro which expands to a string constant.

Referencing the macro twice will cause it to be expanded twice, resulting
in two string instances which have identical content. By default, gcc will
deduplicate these two strings into the same memory region as gcc detects
the duplicated constant, even when optimization turned off (see
-fmerge-constants and -fmerge-all-constants GCC options).

The C Language specification does not require duplicated constants to be
deduplicated, and, in fact, the GCC manual page also explicitly states
this optimization is not performed for all targets.

Visual C++, in debug mode, does not deduplicate constants. This results
in `count += strchr(CALCIUM,x) - CALCIUM` yielding to negative values as
the substracted CALCIUM's expansion resides on a greater memory address
then the memory allocated for the expansion passed to `strchr`. The
value of `count` is used to compute the checksum, which then is not only
faulty, but also used as an array index without previously checking
whether or not the index is within the array bounds (modulo of a negative
integer is negative, which means out of bounds). This will cause very
difficult to predict behavior, in most cases, however, it will cause a
segmentation fault.

Manually allocate a memory range to contain the string, and use
this range instead of expanding the macro multiple times.
2021-06-10 20:29:04 +09:00
..
fonts raster: fix text not scaling for half_int_scaling; UPCEAN font 2020-09-13 13:37:15 +01:00
tests CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
tools Update gen_gs1_lint.php re new Digital Link dlpkey in gs1-format-spec.txt 2021-03-15 15:27:20 +00:00
2of5.c C25STANDARD/C25INTER/C25IATA/C25LOGIC/C25IND: add check digit option (#216) 2021-05-17 20:04:00 +01:00
auspost.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
aztec.c AZTEC: optimize populate_map (good for small data) 2021-05-27 18:33:19 +01:00
aztec.h AZTEC: optimize populate_map (good for small data) 2021-05-27 18:33:19 +01:00
big5.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
bmp.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
bmp.h Better compression for Ultracode in BMP 2020-08-12 13:19:56 +01:00
channel_precalcs.h CHANNEL: use nested loops (CHNCHK) and pre-calculated values for performance 2020-06-10 18:41:36 +01:00
CMakeLists.txt CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
codablock.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
code1.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
code1.h Remove spaces before EOL 2017-10-25 17:23:57 +01:00
code16k.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
code49.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
code49.h Make data types for tables consistent across symbologies 2017-08-09 09:13:37 +01:00
code128.c Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
code128.h New symbology: DPD Code (variation of Code 128) 2020-08-03 12:13:05 +01:00
code.c Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
common.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
common.h CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
composite.c Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
composite.h PDF417/raster: performance large data; common.h inline, module_colour_is_set(); #209 2020-11-01 18:32:55 +00:00
DEVELOPER Update version to 2.6.1 2017-08-27 09:31:02 +01:00
dllversion.c Remove further refs to QZint; win32/README; add zintconfig.h to Win make files 2020-11-24 22:22:12 +00:00
dmatrix.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
dmatrix.h AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
dotcode.c DOTCODE: allow for max 200 cols in CLI, GUI, Tcl; more detailed size error messages 2021-05-28 15:05:06 +01:00
eci_sb.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
eci.c get_best_eci: check UTF-8 before returning 26; move is_valid_utf8 to common 2021-03-21 17:35:52 +00:00
eci.h DATAMATRIX: make EOD encodation strictly ISO 16022 compliant 2021-02-23 00:01:15 +00:00
emf.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
emf.h vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
font.h #209 font.h guard; improve gs1 c82 check, code1 num_digits 2021-02-09 02:51:36 +00:00
gb2312.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
gb2312.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
gb18030.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
gb18030.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
general_field.c #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00:00
general_field.h #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00:00
gif.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
gridmtx.c CLI: Handle UTF-8 args on Windows; -b <barcode name> 2021-01-20 21:15:03 +00:00
gridmtx.h GRIDMATRIX codeword fixes, Project Nayuki optimized encoding modes 2019-12-04 13:45:01 +00:00
gs1_lint.h Update gs1_lint.h re initial index in gs1-format-spec.txt 2021-02-22 19:05:24 +00:00
gs1.c Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
gs1.h #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00:00
hanxin.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
hanxin.h Remove spaces before EOL 2017-10-25 17:23:57 +01:00
imail.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
iso3166.h gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
iso4217.h gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
ksx1001.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
large.c #209 large.c fix oversized arrays by 0-filling; const args, casts 2021-02-11 13:51:07 +00:00
large.h #209 large.c fix oversized arrays by 0-filling; const args, casts 2021-02-11 13:51:07 +00:00
library.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
libzint.rc #206 build: version to 2.9.1.9; ZINT_VERSION_BUILD (9 dev); tools/update_version.php 2020-09-04 16:38:11 +01:00
LICENSE license changed with permission of original copyright holders (see mailing list for details) 2013-05-16 19:26:22 +02:00
mailmark.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
Makefile.mingw #206 build: version to 2.9.1.9; ZINT_VERSION_BUILD (9 dev); tools/update_version.php 2020-09-04 16:38:11 +01:00
maxicode.c MAXICODE: fix shifting from sets C/D/E to A/B (only latch available) 2021-03-28 21:31:45 +01:00
maxicode.h Make data types for tables consistent across symbologies 2017-08-09 09:13:37 +01:00
medical.c Merge String Constant 2021-06-10 20:29:04 +09:00
ms_stdint.h Remove spaces before EOL 2017-10-25 17:23:57 +01:00
output.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
output.h raster/vector: revert to floats for performance, doubles ([2a19b8]) unnecessary 2020-08-09 20:20:16 +01:00
pcx.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
pcx.h Remove spaces before EOL 2017-10-25 17:23:57 +01:00
pdf417.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
pdf417.h PDF417/raster: performance large data; common.h inline, module_colour_is_set(); #209 2020-11-01 18:32:55 +00:00
plessey.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
png.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
postal.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
ps.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
qr.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
qr.h hx_define_mode() if/else; qr.h tabs 2020-11-27 15:24:37 +00:00
raster.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
reedsol_logs.h HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
reedsol.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
reedsol.h HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
rss.c gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
rss.h rss.c: some fixes for separators, allow check digit, refactoring; bwipp_dump.ps 2020-07-10 19:39:32 +01:00
sjis.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
sjis.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
stdint_msvc.h Remove spaces before EOL 2017-10-25 17:23:57 +01:00
svg.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
telepen.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
tif_lzw.h tif.c: Use palette/bilevel/LZW to reduce file size, alpha/CMYK support 2021-03-19 13:09:21 +00:00
tif.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
tif.h tif.c: Use palette/bilevel/LZW to reduce file size, alpha/CMYK support 2021-03-19 13:09:21 +00:00
ultra.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
upcean.c #218 Prevent buffer overflow in ean_leading_zeroes by checking max lengths 2021-02-25 17:14:49 +00:00
vector.c CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
zfiletypes.h Add GS1PARENS_MODE (input_mode) to allow inputting GS1 AIs in parentheses 2021-05-15 12:23:46 +01:00
zint.h CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs 2021-06-10 11:15:39 +01:00
zintconfig.h Add explicit zintconfig.h for non-Cmake Windows build 2020-11-24 07:03:03 +00:00
zintconfig.h.in Take version information from CmakeLists.txt 2020-11-22 11:29:45 +00:00