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

View File

@ -1,5 +1,4 @@
/* code128.c - Handles Code 128 and derivatives */
/*
libzint - the open source barcode library
Copyright (C) 2008-2022 Robin Stuart <rstuart114@gmail.com>
@ -32,11 +31,8 @@
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#include <stdio.h>
#ifdef _MSC_VER
#include <malloc.h>
#endif
#include <assert.h>
#include <stdio.h>
#include "common.h"
#include "code128.h"
#include "gs1.h"
@ -746,11 +742,7 @@ INTERNAL int gs1_128_cc(struct zint_symbol *symbol, unsigned char source[], int
char *d = dest;
int separator_row, linkage_flag;
int reduced_length;
#ifndef _MSC_VER
unsigned char reduced[length + 1];
#else
unsigned char *reduced = (unsigned char *) _alloca(length + 1);
#endif
unsigned char *reduced = (unsigned char *) z_alloca(length + 1);
linkage_flag = 0;
@ -1078,7 +1070,7 @@ INTERNAL int dpd(struct zint_symbol *symbol, unsigned char source[], int length)
int i, p;
unsigned char identifier;
const int mod = 36;
int cd; // Check digit
int cd; /* Check digit */
if (length != 28) {
strcpy(symbol->errtxt, "349: DPD input wrong length (28 characters required)");