Avoid type definition outside of blocks to be VC6 compatible.

This commit is contained in:
Harald Oehlmann 2016-02-24 08:42:15 +01:00
parent 7d6050bd3b
commit 0d7ee10ef5
3 changed files with 14 additions and 7 deletions

View File

@ -1299,7 +1299,7 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], int length) {
break;
case 10:
for (i = 0; i < data_blocks; i++) {
for(int p = 0; p < 10; p++) {
for(p = 0; p < 10; p++) {
if (adjusted_string[i * codeword_size + p] == '1') {
data_part[i] += (0x200 >> p);
}

View File

@ -465,8 +465,9 @@ void qr_binary(int datastream[], int version, int target_binlen, char mode[], in
/* Put data into 8-bit codewords */
for (i = 0; i < current_bytes; i++) {
int p;
datastream[i] = 0x00;
for (int p = 0; p < 8; p++) {
for (p = 0; p < 8; p++) {
if (binary[i * 8 + p] == '1') {
datastream[i] += (0x80 >> p);
}
@ -1299,6 +1300,12 @@ void applyOptimisation(int version, char inputMode[], int inputLength) {
int blockCount = 0;
int i, j;
char currentMode = ' '; // Null
int block;
#ifdef _MSC_VER
int* blockLength;
int* blockMode;
#endif
for (i = 0; i < inputLength; i++) {
if (inputMode[i] != currentMode) {
@ -1311,8 +1318,8 @@ void applyOptimisation(int version, char inputMode[], int inputLength) {
int blockLength[blockCount];
char blockMode[blockCount];
#else
int* blockLength = (int *) _alloca(blockCount * sizeof (int));
int* blockMode = (int *) _alloca(blockMode * sizeof(int));
blockLength = (int *) _alloca(blockCount * sizeof (int));
blockMode = (int *) _alloca(blockCount * sizeof(int));
#endif
j = -1;
@ -1391,7 +1398,7 @@ void applyOptimisation(int version, char inputMode[], int inputLength) {
}
j = 0;
for (int block = 0; block < blockCount; block++) {
for (block = 0; block < blockCount; block++) {
currentMode = blockMode[block];
for (i = 0; i < blockLength[block]; i++) {
inputMode[j] = currentMode;

View File

@ -2011,7 +2011,7 @@ int rss_binary_string(struct zint_symbol *symbol, char source[], char binary_str
/* GS1 DataBar Expanded */
int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len) {
int i, j, k, l, data_chars, vs[21], group[21], v_odd[21], v_even[21];
int i, j, k, l, p, data_chars, vs[21], group[21], v_odd[21], v_even[21];
char substring[21][14], latch;
int char_widths[21][8], checksum, check_widths[8], c_group;
int check_char, c_odd, c_even, elements[235], pattern_width, reader, writer;
@ -2067,7 +2067,7 @@ int rssexpanded(struct zint_symbol *symbol, unsigned char source[], int src_len)
for (i = 0; i < data_chars; i++) {
vs[i] = 0;
for (int p = 0; p < 12; p++) {
for (p = 0; p < 12; p++) {
if (substring[i][p] == '1') {
vs[i] += (0x800 >> p);
}