Make command line version compile with MS-VC6 and QT-Version with MS-VC8

This commit is contained in:
Harald Oehlmann 2015-08-18 13:50:42 +02:00
parent 2e5fe31ebf
commit b7b7564457
14 changed files with 198 additions and 52 deletions

View file

@ -771,6 +771,8 @@ int evaluate(unsigned char *grid, int size, int pattern)
int dark_mods;
int percentage, k, k2;
char str[15];
int m;
int smallest;
#ifndef _MSC_VER
char local[size * size];
@ -987,7 +989,7 @@ int evaluate(unsigned char *grid, int size, int pattern)
}
}
percentage = 100 * (dark_mods / (size * size));
int m=0;
m=0;
for(x = 0; x < 100; x+=5) {
if(x<percentage)
m=x;
@ -997,7 +999,7 @@ int evaluate(unsigned char *grid, int size, int pattern)
k=abs((m-50)/5);
k2=abs((m+5-50)/5);
int smallest=k;
smallest=k;
if(k2<smallest)
smallest=k2;
@ -1214,7 +1216,10 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
int jisdata[length + 1];
char mode[length + 1];
#else
int* utfdata = (int *)_alloca((length + 1) * sizeof(int));
int* datastream;
int* fullstream;
unsigned char* grid;
int* utfdata = (int *)_alloca((length + 1) * sizeof(int));
int* jisdata = (int *)_alloca((length + 1) * sizeof(int));
char* mode = (char *)_alloca(length + 1);
#endif
@ -1325,8 +1330,8 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
int datastream[target_binlen + 1];
int fullstream[qr_total_codewords[version - 1] + 1];
#else
int* datastream = (int *)_alloca((target_binlen + 1) * sizeof(int));
int* fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int));
datastream = (int *)_alloca((target_binlen + 1) * sizeof(int));
fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int));
#endif
qr_binary(datastream, version, target_binlen, mode, jisdata, length, gs1, est_binlen);
@ -1336,7 +1341,7 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER
unsigned char grid[size * size];
#else
unsigned char* grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
#endif
for(i = 0; i < size; i++) {
@ -2214,6 +2219,9 @@ int microqr(struct zint_symbol *symbol, unsigned char source[], int length)
int binary_count[4];
int ecc_level, autoversion, version;
int n_count, a_count, bitmask, format, format_full;
#ifdef _MSC_VER
unsigned char* grid;
#endif
if(length > 35) {
strcpy(symbol->errtxt, "Input data too long");
@ -2384,7 +2392,7 @@ int microqr(struct zint_symbol *symbol, unsigned char source[], int length)
#ifndef _MSC_VER
unsigned char grid[size * size];
#else
unsigned char* grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
grid = (unsigned char *)_alloca((size * size) * sizeof(unsigned char));
#endif
for(i = 0; i < size; i++) {