Commit graph

57 commits

Author SHA1 Message Date
gitlost
930f458979 backend: define z_alloca() and use for both Unix and Windows;
replace double-slash comments with old-skool slash asterisk ones;
  define uint16_t etc for Windows ourselves and remove ms_stdint.h &
  stdint_msvc.h as no longer used;
  (backend (excepting test suite) now C89 compatible)
LICENSE: move from backend to root and move COPYING to frontend, with
  copies in frontend_qt & backend_qt, so in where it applies;
  add LICENSE section from manual to root README
2022-07-14 16:01:30 +01:00
gitlost
0b3fe8db93 GUI: remove sizeConstraint so squashable again (sigh)
- make Sequence Format textbox bigger (on own line)
  - suppress question mark in Windows dialogs
AUSPOST: more standard error messages
backend: add & use z_isdigit/upper/lower() macros
docs: 20-bit Unicode -> 21-bit Unicode
2022-06-24 14:38:48 +01:00
gitlost
f58c80e290 Add multiple segments support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, HANXIN, MAXICODE, MICROPDF417, PDF417, QRCODE, RMQR, ULTRA
RMQR: fix ECI encoding (wrong bit length for indicator)
MICROQR: check versions M1 and M2 for allowed characters so as to give
  better error messages
DOTCODE: some small optimizations
common.c: add is_chr(), segs_length(), segs_cpy()
CODEONE/CODE128/DOTCODE/GRIDMATRIX/HANXIN/MAXICODE/QRCODE/ULTRA: add
  namespace prefixes to static funcs/data
includes: use Z_ prefix, unuse double underscore prefixes (guard defines)
manual.txt: compress some tables using double/treble column sets
2022-05-09 19:50:50 +01:00
gitlost
4e72a541f7 PDF417: fix cols/rows calculation to require multiple <= 928 codewords;
add specify rows option (option_3) (#204);
  warn if cols increased from specified (back-incompatible);
  move table definitions from "pdf417.h" to new "pdf417_tabs.h" and
  make INTERNAL_DATA and share with composite.c (saves ~10K);
  prefix routines and tables with "pdf_";
  some small performance improvements through if/elses, pdf_textprocess()
  & pdf_numbprocess() loop simplifications
MICROQR: fix debug access crash on printing non-NUL-terminating binary
DATAMATRIX: fix missing ++ from "[tp]" at C40/TEXT EOD processing of GS1
  (though probably never reached); use "[tp++]" throughout
Add const to static tables missing it and also to some variables
Change "debug" -> "debug_print" throughout
2021-10-30 22:00:31 +01:00
gitlost
fab7435fac Performance improvements for linear encoding and raster output
- use fixed-length string tables (mostly) instead of (char *) pointer ones
   (saves ~40K)
 - re-use C128Table for CODABLOCKF and CODE16K
   (required removal of Stop character and extra CODE16K-only entry)
 - use pointer to destination and copy (memcpy/strcpy(), bin_append_posn())
   instead of concatenating (strcat()) (mostly)
 - replace last remaining bin_append()s with bin_append_posn();
   bin_append() removed
 - add length arg to toupper() and expand() (avoids strlen())
 - change is_sane() to use table-based flags (avoids an iteration)
 - rename lookup() to is_sane_lookup() and change to check and return posns
   and use in pointer to destination loops (avoids strcat()s)
 - remove special case PHARMA in expand() (dealt with in pharma())
 - make #define SILVER/CALCIUM/TECHNETIUM/KRSET etc static strings
 - replace strchr() -> posn()
 - CODE128: populate destination once in checksum loop; re-use and export
   some more routines (c128_set_a/b/c(), c128_put_in_set()) for sharing;
   prefix defines (SHIFTA -> C128_SHIFTA etc) and existing exported routines
 - use factor XOR toggle trick in checksum calcs (avoids branch)
 - raster.c: fill out single 1-pixel row and copy using new draw_bar_line(),
   copy_bar_line() routines; similarly in buffer_plot compare previous line &
   copy if same (same technique as used to improve non-half-integer scaling,
   significant performance increase, (c) codemonkey82);
   also done for PNG (BMP/GIF/PCX/TIFF not done)
 - raster/vector/output.c: shorten "output_" prefix -> "out_";
   sync vector to other raster changes to try to keep source files similar
 - 2of5.c: prefix "c25_"
JAPANPOST: return error if input data truncated (backward incompatible)
DAFT: max chars 50 -> 100
common.c: istwodigit() -> is_twodigit()
common.c/emf.c/output.c: use some further stripf()s (MSVC6 float variations)
library.c: new check_output_args() helper
zint.h: add BARCODE_LAST marker and use in library.c
QRCODE: remove a NOLINT (requires clang-tidy-13), one remaining
CMake: separate no-optimize from ZINT_DEBUG into new ZINT_NOOPT option
2021-10-20 23:05:30 +01:00
gitlost
72eac41c34 Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility
Rename barcode funcs to same as BARCODE_XXX name
library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also
general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION
MAILMARK: fuller error messages
CODABAR: add option to show check character in HRT
zint.h: use 0xNNNN for OR-able defines
GUI: add guard descent height reset button, add Zint version to window title,
  static get_zint_version() method, use QStringLiteral (QSL shorthand),
  use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons,
  add saveAs shortcut, add main menu, context menus and actions, add help,
  reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF,
  lessen triggering of update_preview(), shorten names of getters/setters,
  simplify/shorten some update_preview() logic in switch,
  CODEONE disable structapp for Version S
qzint.cpp: add on_errored signal, add missing getters, add test
2021-10-09 00:13:39 +01:00
gitlost
c0791ad85e Add Structured Append support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, MAXICODE, MICROPDF417, PDF417, QRCODE, ULTRA
DOTCODE: use pre-calculated generator poly coeffs in Reed-Solomon for
  performance improvement
PDF417/MICROPDF417: use common routine pdf417_initial()
GUI: code lines <= 118, shorthand widget_obj(),
  shorten calling upcean_addon_gap(), upcean_guard_descent()
various backend: var name debug -> debug_print
2021-09-28 21:42:44 +01:00
gitlost
b015e38da0 composite: fix buffer overflow for large linear, small composite (500 -> 1000)
composite: clear errtxt when bumping from CC-A -> CC-B -> CC-C
composite: CC-C adjustment 53 -> 52 (same as BWIPP) with proper explanation
composite: remove unneeded > 11805 length check
CODEONE: remove unneeded extended ASCII check in C40 count
GS1_128/CODE16K: remove unneeded initial GS1 mode '[' check
PDF417: remove unneeded second option_2 > 30 check
Document some "Not reached" lines (code coverage)
Update bwipp_dump.ps
GUI: window/tab height +5 so 2 full lines for composite edit box (Ubuntu)
manual: dash -> hyphen, PDF417 "check digit" -> "error correction", DMRE ref
tests: further test cases for CODEONE/CODE16K/common/composite/DATAMATRIX/
DOTCODE/gs1/MAXICODE/PDF417/postal/QRCODE
2021-08-05 16:34:45 +01:00
gitlost
f03da2f4ba CODE128: suppress cppcheck out-of-bounds warning; plus others (#233) 2021-07-07 13:58:04 +01:00
gitlost
9b02cd5221 CODEONE: is_last_single_ascii() out-of-bounds sp + 1, #232 CI-Fuzz, props Jan Schrewe 2021-07-05 11:52:43 +01:00
gitlost
37fac73cb1 DATAMATRIX/CODEONE: Use LCM in look ahead tests to avoid floats (#228) 2021-06-29 22:02:24 +01:00
gitlost
8c419ab4fb DATAMATRIX/DBAR_LTD: some hacks to get around MSVC 2015/2019 x64 optimizer bugs 2021-06-27 15:58:27 +01:00
gitlost
e5115bad07 Change height and row_height array to floats: VC6, CodeQL fixes 2021-06-20 00:05:45 +01:00
gitlost
c693482aa1 Change height and row_height array to floats; DAFT tracker ratio 2021-06-19 13:11:23 +01:00
gitlost
4a8cac2a5a CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs
PLESSEY: add options NCR weighted mod-10, hide check digit(s) in HRT
test suite: now runnable under MSVC 2019, 2017, 2015, MinGW/MSYS
win32/README: update with MSVC 2019 and CMake instructions
2021-06-10 11:15:39 +01:00
gitlost
88d1a9f625 DATAMATRIX: make EOD encodation strictly ISO 16022 compliant 2021-02-23 00:01:15 +00:00
gitlost
b3610d3c43 #209 font.h guard; improve gs1 c82 check, code1 num_digits 2021-02-09 02:51:36 +00:00
gitlost
6274140c73 CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
gitlost
f62a678d0f #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
gitlost
cd214addba HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
gitlost
e8a238aad1 large.c: replace binary_load/add() etc with uint64_t based large_load/add() etc for performance 2020-06-14 14:42:40 +01:00
gitlost
6242e02638 CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
Robin Stuart
b4182cbc19 Remove unneccessary length checks in Code1
Revokes commit #024490 and re-establishes commit #0c00ec
Relating to #184 thanks to Milton Neal and Git Lost
2020-04-01 19:27:49 +01:00
Robin Stuart
0244904c1f Prevent buffer overrun in Code One
Fixes #184 reported by Milton Neal
2020-03-29 14:23:31 +01:00
gitlost
0c00ece9f5 #181 OSS-Fuzz CODEONE fix, double indexing typo 2020-03-28 10:13:06 +00:00
gitlost
bca82ecc0d libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
gitlost
fed7378675 Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
Boris Zentner
31cc0ae78a Remove spaces before EOL 2017-10-25 17:23:57 +01:00
Boris Zentner
45441a6da7 Fix mixed unix / windows EOL 2017-10-25 17:15:35 +01:00
Harald Oehlmann
f83e5b1501 Make compile with MS-VC6 2017-10-16 19:26:54 +02:00
Rodrigo Torres
4963a772db Refactor 2017-09-11 19:21:33 +01:00
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +01:00
Robin Stuart
19c3755ed0 Simplify conversion to binary with common function
No change to functionality
2017-05-14 08:15:08 +01:00
Robin Stuart
19ba8a34c4 Update to version 2.6.0 and update copyright to 2017 2017-05-11 21:14:38 +01:00
Robin Stuart
5acbffff0d Consistently throw an error if data does not fit in specified size symbol
See ticket #57
2017-04-11 09:26:39 +01:00
Robin Stuart
4561a66067 Add identifiers to error messages
To ease the debug process
2016-10-28 22:40:40 +01:00
Robin Stuart
b13efe334a Slight code reduction - use loops when converting to or from binary 2016-09-17 18:22:26 +01:00
Robin Stuart
2c2200a7cb modifications for VS2015, some
additional static/const's and a few bugfixes for HanXin and DotStream.

Patch by Michael <virtual_worlds@gmx.de>
2016-09-05 22:06:50 +01:00
Harald Oehlmann
90407bffce Removed include malloc.h for all non-Windows so FreeBSD compiles.
Removed include of sys/malloc.h for APPLE, probably not used.
Ticket #18
2016-04-03 22:33:01 +02:00
Robin Stuart
f17f10fa7c Replace local concat() and roundup() with C library defaults
Patch by Oxy (Michael) <virtual_worlds@gmx.de>
Ref: https://sourceforge.net/p/zint/mailman/message/34896811/
2016-03-02 21:12:38 +00:00
Robin Stuart
5d9ce6f684 Improvements from Oxy patch
Original email reads...
It does not contain any fundamental changes or new functions but a lot of improvements which I have done over time (added several const/static specifiers, replaced repeated if-conditions by if-else, removed some warnings).
2016-02-29 19:42:32 +00:00
Robin Stuart
9372aa4e48 Remove int declarations in for loops for Visual Studio 2016-02-23 19:21:48 +00:00
Robin Stuart
8a88ffdd7b Code format and audit, part 2
Update copyright info, remove unused code, etc.
2016-02-20 10:50:15 +00:00
Robin Stuart
77cdf77690 Code format and audit, part 1
Update copyright info, remove unused code, etc.
2016-02-20 09:38:03 +00:00
Robin Stuart
2e59058615 Avoid possible confusion with Windows error code
Bugfix by Oxy Genic
Ref: https://sourceforge.net/p/zint/mailman/message/34857131/
2016-02-17 10:37:20 +00:00
oxygenic
1a7863520b license changed with permission of original copyright holders (see mailing list for details) 2013-05-16 19:26:38 +02:00
oxygenic
4c45bac1ae reworked 2012-12-30 14:55:05 +01:00
openapc
bf2dbe7494 code reworked 2012-12-29 19:37:03 +01:00
Robin Stuart
b30f8e110f Corrected error-correction in Code 1
Code 1 now uses correct Reed-Solomon error correction polynomials.
With thanks to Terry Burton.
2011-03-07 12:55:22 +00:00
brianray
27ce2abc7b ifdefs needed to find malloc.h on the mac. 2010-02-28 03:43:32 +00:00