1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-05-31 23:28:27 -04:00

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
This commit is contained in:
gitlost 2022-07-14 16:01:30 +01:00
parent 5ee3895bca
commit 930f458979
70 changed files with 2650 additions and 2038 deletions
backend

View file

@ -30,15 +30,12 @@
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#include <math.h>
#include <stdio.h>
#include "common.h"
#include "code1.h"
#include "reedsol.h"
#include "large.h"
#include <stdio.h>
#include <math.h>
#ifdef _MSC_VER
#include <malloc.h>
#endif
/* Add solid bar */
static void c1_horiz(struct zint_symbol *symbol, const int row_no, const int full) {
@ -486,13 +483,8 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], int len
int byte_start = 0;
const int debug_print = symbol->debug & ZINT_DEBUG_PRINT;
const int eci_length = length + 7 + chr_cnt(source, length, '\\');
#ifndef _MSC_VER
unsigned char eci_buf[eci_length + 1];
int num_digits[eci_length + 1];
#else
unsigned char *eci_buf = (unsigned char *) _alloca(eci_length + 1);
int *num_digits = (int *) _alloca(sizeof(int) * (eci_length + 1));
#endif
unsigned char *eci_buf = (unsigned char *) z_alloca(eci_length + 1);
int *num_digits = (int *) z_alloca(sizeof(int) * (eci_length + 1));
memset(num_digits, 0, sizeof(int) * (eci_length + 1));