1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-05-22 03:05:11 -04:00

Add BARCODE_MEMORY_FILE to symbol->output_options to allow

outputting to in-memory buffer `symbol->memfile` instead of to
  file `symbol->outfile`, ticket 
Add "README.clang-tidy" and ".clang-tidy" options file
Suppress some warnings
This commit is contained in:
gitlost 2023-12-27 19:20:19 +00:00
parent 070162214b
commit 98f86727cc
59 changed files with 2407 additions and 1262 deletions
backend

View file

@ -244,12 +244,14 @@ static int save_raster_image_to_file(struct zint_symbol *symbol, const int image
#ifndef ZINT_NO_PNG
error_number = png_pixel_plot(symbol, rotated_pixbuf);
#else
if (rotate_angle) {
free(rotated_pixbuf);
}
return ZINT_ERROR_INVALID_OPTION;
error_number = ZINT_ERROR_INVALID_OPTION;
#endif
break;
#if defined(__GNUC__) && !defined(__clang__) && defined(NDEBUG) && defined(ZINT_NO_PNG)
/* Suppress gcc warning <unknown> may be used uninitialized - only when Release and ZINT_NO_PNG */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
case OUT_PCX_FILE:
error_number = pcx_pixel_plot(symbol, rotated_pixbuf);
break;
@ -262,6 +264,9 @@ static int save_raster_image_to_file(struct zint_symbol *symbol, const int image
default:
error_number = bmp_pixel_plot(symbol, rotated_pixbuf);
break;
#if defined(__GNUC__) && !defined(__clang__) && defined(NDEBUG) && defined(ZINT_NO_PNG)
#pragma GCC diagnostic pop
#endif
}
if (rotate_angle) {
@ -1417,6 +1422,10 @@ INTERNAL int plot_raster(struct zint_symbol *symbol, int rotate_angle, int file_
if (error != 0) {
return error;
}
if (symbol->rows <= 0) {
strcpy(symbol->errtxt, "664: No rows");
return ZINT_ERROR_INVALID_OPTION;
}
if (symbol->symbology == BARCODE_MAXICODE) {
error = plot_raster_maxicode(symbol, rotate_angle, file_type);