1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-18 10:27:09 +00: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

View File

@@ -46,9 +46,6 @@
*/
#include <assert.h>
#include <stdio.h>
#ifdef _MSC_VER
#include <malloc.h>
#endif
#include "common.h"
#include "large.h"
@@ -286,11 +283,7 @@ INTERNAL void large_uint_array(const large_int *t, unsigned int *uint_array, con
/* As `large_uint_array()` above, except output to unsigned char array */
INTERNAL void large_uchar_array(const large_int *t, unsigned char *uchar_array, const int size, int bits) {
int i;
#ifndef _MSC_VER
unsigned int uint_array[size ? size : 1]; /* Avoid run-time warning if size is 0 */
#else
unsigned int *uint_array = (unsigned int *) _alloca(sizeof(unsigned int) * (size ? size : 1));
#endif
unsigned int *uint_array = (unsigned int *) z_alloca(sizeof(unsigned int) * (size ? size : 1));
large_uint_array(t, uint_array, size, bits);