Make zint compile on MS-VC6. Adopt makefiles to new file list.

This commit is contained in:
Harald Oehlmann 2019-12-05 19:19:37 +01:00
parent 5fe97772cb
commit 045a9e3b00
7 changed files with 27 additions and 21 deletions

View File

@ -171,7 +171,7 @@ static void define_mode(unsigned int gbdata[], const size_t length, char* mode,
#ifndef _MSC_VER #ifndef _MSC_VER
char char_modes[length][GM_NUM_MODES]; char char_modes[length][GM_NUM_MODES];
#else #else
char* char_modes = (char*) _alloca(length * GM_NUM_MODES); char** char_modes = (char**) _alloca(length * GM_NUM_MODES);
#endif #endif
memset(char_modes, 0, length * GM_NUM_MODES); memset(char_modes, 0, length * GM_NUM_MODES);

View File

@ -513,6 +513,22 @@ static void qr_binary(unsigned char datastream[], const int version, const int t
/* Split data into blocks, add error correction and then interleave the blocks and error correction data */ /* Split data into blocks, add error correction and then interleave the blocks and error correction data */
static void add_ecc(unsigned char fullstream[], const unsigned char datastream[], const int version, const int data_cw, const int blocks, int debug) { static void add_ecc(unsigned char fullstream[], const unsigned char datastream[], const int version, const int data_cw, const int blocks, int debug) {
int ecc_cw; int ecc_cw;
int short_data_block_length;
int qty_long_blocks;
int qty_short_blocks;
int ecc_block_length;
int i, j, length_this_block, posn;
#ifdef _MSC_VER
unsigned char* data_block;
unsigned char* ecc_block;
unsigned char* interleaved_data;
unsigned char* interleaved_ecc;
#endif
short_data_block_length = data_cw / blocks;
qty_long_blocks = data_cw % blocks;
qty_short_blocks = blocks - qty_long_blocks;
ecc_block_length = ecc_cw / blocks;
if (version < RMQR_VERSION) { if (version < RMQR_VERSION) {
ecc_cw = qr_total_codewords[version - 1] - data_cw; ecc_cw = qr_total_codewords[version - 1] - data_cw;
@ -520,11 +536,6 @@ static void add_ecc(unsigned char fullstream[], const unsigned char datastream[]
ecc_cw = rmqr_total_codewords[version - RMQR_VERSION] - data_cw; ecc_cw = rmqr_total_codewords[version - RMQR_VERSION] - data_cw;
} }
int short_data_block_length = data_cw / blocks;
int qty_long_blocks = data_cw % blocks;
int qty_short_blocks = blocks - qty_long_blocks;
int ecc_block_length = ecc_cw / blocks;
int i, j, length_this_block, posn;
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char data_block[short_data_block_length + 2]; unsigned char data_block[short_data_block_length + 2];
@ -532,10 +543,10 @@ static void add_ecc(unsigned char fullstream[], const unsigned char datastream[]
unsigned char interleaved_data[data_cw + 2]; unsigned char interleaved_data[data_cw + 2];
unsigned char interleaved_ecc[ecc_cw + 2]; unsigned char interleaved_ecc[ecc_cw + 2];
#else #else
unsigned char* data_block = (unsigned char *) _alloca(short_data_block_length + 2); data_block = (unsigned char *) _alloca(short_data_block_length + 2);
unsigned char* ecc_block = (unsigned char *) _alloca(ecc_block_length + 2); ecc_block = (unsigned char *) _alloca(ecc_block_length + 2);
unsigned char* interleaved_data = (unsigned char *) _alloca(data_cw + 2); interleaved_data = (unsigned char *) _alloca(data_cw + 2);
unsigned char* interleaved_ecc = (unsigned char *) _alloca(ecc_cw + 2); interleaved_ecc = (unsigned char *) _alloca(ecc_cw + 2);
#endif #endif
posn = 0; posn = 0;

View File

@ -109,7 +109,6 @@ SOURCES += ../backend/2of5.c \
../backend/ps.c \ ../backend/ps.c \
../backend/raster.c \ ../backend/raster.c \
../backend/reedsol.c \ ../backend/reedsol.c \
../backend/render.c \
../backend/rss.c \ ../backend/rss.c \
../backend/sjis.c \ ../backend/sjis.c \
../backend/svg.c \ ../backend/svg.c \

View File

@ -84,6 +84,8 @@ TEA_ADD_SOURCES([
../backend/dmatrix.c ../backend/dmatrix.c
../backend/dotcode.c ../backend/dotcode.c
../backend/eci.c ../backend/eci.c
../backend/gb2312.c
../backend/general_field.c
../backend/gif.c ../backend/gif.c
../backend/gridmtx.c ../backend/gridmtx.c
../backend/gs1.c ../backend/gs1.c
@ -91,6 +93,7 @@ TEA_ADD_SOURCES([
../backend/imail.c ../backend/imail.c
../backend/large.c ../backend/large.c
../backend/library.c ../backend/library.c
../backend/mailmark.c
../backend/maxicode.c ../backend/maxicode.c
../backend/medical.c ../backend/medical.c
../backend/pcx.c ../backend/pcx.c
@ -102,8 +105,8 @@ TEA_ADD_SOURCES([
../backend/qr.c ../backend/qr.c
../backend/raster.c ../backend/raster.c
../backend/reedsol.c ../backend/reedsol.c
../backend/render.c
../backend/rss.c ../backend/rss.c
../backend/sjis.c
../backend/svg.c ../backend/svg.c
../backend/telepen.c ../backend/telepen.c
../backend/tif.c ../backend/tif.c

View File

@ -240,10 +240,6 @@ SOURCE=..\backend\reedsol.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\backend\render.c
# End Source File
# Begin Source File
SOURCE=..\backend\rss.c SOURCE=..\backend\rss.c
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -28,13 +28,14 @@ FORMS += extData.ui \
grpDBExtend.ui \ grpDBExtend.ui \
grpDM.ui \ grpDM.ui \
grpGrid.ui \ grpGrid.ui \
grpHX.ui \
grpMaxicode.ui \ grpMaxicode.ui \
grpMicroPDF.ui \ grpMicroPDF.ui \
grpMQR.ui \ grpMQR.ui \
grpMSICheck.ui \ grpMSICheck.ui \
grpPDF417.ui \ grpPDF417.ui \
grpQR.ui \ grpQR.ui \
grpHX.ui \ grpRMQR.ui \
mainWindow.ui \ mainWindow.ui \
grpDotCode.ui grpDotCode.ui

View File

@ -248,10 +248,6 @@ SOURCE=..\..\backend\reedsol.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\backend\render.c
# End Source File
# Begin Source File
SOURCE=..\..\backend\rss.c SOURCE=..\..\backend\rss.c
# End Source File # End Source File
# Begin Source File # Begin Source File