0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

Zint has been pached for MSVC2010

This commit is contained in:
Arin Alexander 2016-03-22 15:49:35 +03:00
parent 58d2063438
commit 7a10231858
4 changed files with 25 additions and 12 deletions

View File

@ -658,9 +658,11 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], int length)
int comp_loop = 4; int comp_loop = 4;
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char local_source[length + 1]; unsigned char local_source[length + 1];
#else #else
unsigned char* local_source = (unsigned char*)_alloca(length + 1); unsigned int* data_part;
unsigned int* ecc_part;
unsigned char* local_source = (unsigned char*)_alloca(length + 1);
#endif #endif
memset(binary_string,0,20000); memset(binary_string,0,20000);
@ -996,8 +998,8 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned int data_part[data_blocks + 3], ecc_part[ecc_blocks + 3]; unsigned int data_part[data_blocks + 3], ecc_part[ecc_blocks + 3];
#else #else
unsigned int* data_part = (unsigned int*)_alloca((data_blocks + 3) * sizeof(unsigned int)); data_part = (unsigned int*)_alloca((data_blocks + 3) * sizeof(unsigned int));
unsigned int* ecc_part = (unsigned int*)_alloca((ecc_blocks + 3) * sizeof(unsigned int)); ecc_part = (unsigned int*)_alloca((ecc_blocks + 3) * sizeof(unsigned int));
#endif #endif
/* Copy across data into separate integers */ /* Copy across data into separate integers */
memset(data_part,0,(data_blocks + 2)*sizeof(int)); memset(data_part,0,(data_blocks + 2)*sizeof(int));

View File

@ -920,6 +920,7 @@ int grid_matrix(struct zint_symbol *symbol, unsigned char source[], int length)
#else #else
int* utfdata = (int *)_alloca((length + 1) * sizeof(int)); int* utfdata = (int *)_alloca((length + 1) * sizeof(int));
int* gbdata = (int *)_alloca((length + 1) * sizeof(int)); int* gbdata = (int *)_alloca((length + 1) * sizeof(int));
char* grid;
#endif #endif
for(i = 0; i < 1460; i++) { for(i = 0; i < 1460; i++) {
@ -1041,7 +1042,7 @@ int grid_matrix(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER #ifndef _MSC_VER
char grid[size * size]; char grid[size * size];
#else #else
char* grid = (char *)_alloca((size * size) * sizeof(char)); grid = (char *)_alloca((size * size) * sizeof(char));
#endif #endif
for(x = 0; x < size; x++) { for(x = 0; x < size; x++) {

View File

@ -578,7 +578,10 @@ int reduced_charset(struct zint_symbol *symbol, unsigned char *source, int lengt
int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *source, int length) int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *source, int length)
{ {
int error_number, error_buffer, i; #ifdef _MSC_VER
unsigned char* local_source;
#endif
int error_number, error_buffer, i;
error_number = 0; error_number = 0;
if(length == 0) { if(length == 0) {
@ -596,7 +599,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *source, int lengt
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char local_source[length + 1]; unsigned char local_source[length + 1];
#else #else
unsigned char* local_source = (unsigned char*)_alloca(length + 1); local_source = (unsigned char*)_alloca(length + 1);
#endif #endif
/* First check the symbology field */ /* First check the symbology field */

View File

@ -1004,6 +1004,9 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
int jisdata[length + 1]; int jisdata[length + 1];
char mode[length + 1]; char mode[length + 1];
#else #else
int* datastream;
int* fullstream;
unsigned char* grid;
int* utfdata = (int *)_alloca((length + 1) * sizeof(int)); int* utfdata = (int *)_alloca((length + 1) * sizeof(int));
int* jisdata = (int *)_alloca((length + 1) * sizeof(int)); int* jisdata = (int *)_alloca((length + 1) * sizeof(int));
char* mode = (char *)_alloca(length + 1); char* mode = (char *)_alloca(length + 1);
@ -1115,8 +1118,8 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
int datastream[target_binlen + 1]; int datastream[target_binlen + 1];
int fullstream[qr_total_codewords[version - 1] + 1]; int fullstream[qr_total_codewords[version - 1] + 1];
#else #else
int* datastream = (int *)_alloca((target_binlen + 1) * sizeof(int)); datastream = (int *)_alloca((target_binlen + 1) * sizeof(int));
int* fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int)); fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int));
#endif #endif
qr_binary(datastream, version, target_binlen, mode, jisdata, length, gs1, est_binlen); qr_binary(datastream, version, target_binlen, mode, jisdata, length, gs1, est_binlen);
@ -1126,7 +1129,7 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char grid[size * size]; unsigned char grid[size * size];
#else #else
unsigned char* grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char)); grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
#endif #endif
for(i = 0; i < size; i++) { for(i = 0; i < size; i++) {
@ -2000,6 +2003,10 @@ int microqr(struct zint_symbol *symbol, unsigned char source[], int length)
int ecc_level, autoversion, version; int ecc_level, autoversion, version;
int n_count, a_count, bitmask, format, format_full; int n_count, a_count, bitmask, format, format_full;
#ifdef _MSC_VER
unsigned char* grid;
#endif
if(length > 35) { if(length > 35) {
strcpy(symbol->errtxt, "Input data too long"); strcpy(symbol->errtxt, "Input data too long");
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
@ -2169,7 +2176,7 @@ int microqr(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char grid[size * size]; unsigned char grid[size * size];
#else #else
unsigned char* grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char)); grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
#endif #endif
for(i = 0; i < size; i++) { for(i = 0; i < size; i++) {