CODE128: optimize for extended ASCII as well using techniques from

BWIPP minimal encoding by Bue Jensen (BWIPP PR #278);
  new extra escape `\^@` to turn off manual switching
zint.h: increase `symbol->text` size 200 -> 256 (means that for
  the moment can no longer generate ZINT_WARN_HRT_TRUNCATED)
GS1_128/GS1_128_CC: warn if READER_INIT option used
CODE16K: move `c16k_set_a/b/c()` routines from "code128.c" and
  rename `c16k_` (also `C128_` defines to `C16K_`)
common: make `itoc()` simple macro which adds '0' (>= 10 now ':',
  ';' etc) and adjust `expand()` accordingly for slight speed-up
general: EXTRA_ESCAPE_MODE now implies ESCAPE_MODE
tests: update BWIPP to latest and enable CODE128AB ("suppressc");
  new test args '-n' (exclude func) and '-m' (match func)
This commit is contained in:
gitlost 2024-11-18 05:08:52 +00:00
parent c9909d3d91
commit 86b6a0553b
23 changed files with 1113 additions and 1017 deletions

View file

@ -46,14 +46,6 @@ INTERNAL int ctoi(const char source) {
return -1;
}
/* Converts an integer value to its hexadecimal character */
INTERNAL char itoc(const int source) {
if ((source >= 0) && (source <= 9)) {
return ('0' + source);
}
return ('A' - 10 + source);
}
/* Converts decimal string of length <= 9 to integer value. Returns -1 if not numeric */
INTERNAL int to_int(const unsigned char source[], const int length) {
int val = 0;
@ -219,17 +211,15 @@ INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const
INTERNAL void expand(struct zint_symbol *symbol, const char data[], const int length) {
int reader;
int writer, i;
int latch, num;
int writer = 0;
int latch = 1;
const int row = symbol->rows;
symbol->rows++;
writer = 0;
latch = 1;
for (reader = 0; reader < length; reader++) {
num = ctoi(data[reader]);
int i;
const int num = data[reader] - '0';
assert(num >= 0);
for (i = 0; i < num; i++) {
if (latch) {