1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-19 19:07:09 +00:00

ERROR_* renamed to ZERROR_*

This commit is contained in:
tgotic
2011-01-17 19:41:01 +01:00
parent 645f9ab344
commit f8ca218630

View File

@@ -71,7 +71,7 @@ void maxi_do_secondary_chk_odd( int ecclen )
datalen = 84; datalen = 84;
for(j = 0; j < datalen; j += 1) for(j = 0; j < datalen; j += 1)
if ((j % 2) == 1) // odd if (j & 1) // odd
data[(j-1)/2] = maxi_codeword[j + 20]; data[(j-1)/2] = maxi_codeword[j + 20];
rs_encode(datalen/2, data, results); rs_encode(datalen/2, data, results);
@@ -96,7 +96,7 @@ void maxi_do_secondary_chk_even(int ecclen )
rs_init_code(ecclen, 1); rs_init_code(ecclen, 1);
for(j = 0; j < datalen + 1; j += 1) for(j = 0; j < datalen + 1; j += 1)
if ((j % 2) == 0) // even if (!(j & 1)) // even
data[j/2] = maxi_codeword[j + 20]; data[j/2] = maxi_codeword[j + 20];
rs_encode(datalen/2, data, results); rs_encode(datalen/2, data, results);
@@ -128,7 +128,7 @@ int maxi_text_process(int mode, unsigned char source[], int length)
int set[144], character[144], i, j, done, count, current_set; int set[144], character[144], i, j, done, count, current_set;
if(length > 138) { if(length > 138) {
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
for(i = 0; i < 144; i++) { for(i = 0; i < 144; i++) {
@@ -452,15 +452,15 @@ int maxi_text_process(int mode, unsigned char source[], int length)
} while (i <= 143); } while (i <= 143);
if(((mode ==2) || (mode == 3)) && (length > 84)) { if(((mode ==2) || (mode == 3)) && (length > 84)) {
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
if(((mode == 4) || (mode == 6)) && (length > 93)) { if(((mode == 4) || (mode == 6)) && (length > 93)) {
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
if((mode == 5) && (length > 77)) { if((mode == 5) && (length > 77)) {
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
@@ -598,19 +598,19 @@ int maxicode(struct zint_symbol *symbol, unsigned char source[], int length)
if((mode < 2) || (mode > 6)) { /* Only codes 2 to 6 supported */ if((mode < 2) || (mode > 6)) { /* Only codes 2 to 6 supported */
strcpy(symbol->errtxt, "Invalid Maxicode Mode"); strcpy(symbol->errtxt, "Invalid Maxicode Mode");
return ERROR_INVALID_OPTION; return ZERROR_INVALID_OPTION;
} }
if((mode == 2) || (mode == 3)) { /* Modes 2 and 3 need data in symbol->primary */ if((mode == 2) || (mode == 3)) { /* Modes 2 and 3 need data in symbol->primary */
if(lp != 15) { if(lp != 15) {
strcpy(symbol->errtxt, "Invalid Primary String"); strcpy(symbol->errtxt, "Invalid Primary String");
return ERROR_INVALID_DATA; return ZERROR_INVALID_DATA;
} }
for(i = 9; i < 15; i++) { /* check that country code and service are numeric */ for(i = 9; i < 15; i++) { /* check that country code and service are numeric */
if((symbol->primary[i] < '0') || (symbol->primary[i] > '9')) { if((symbol->primary[i] < '0') || (symbol->primary[i] > '9')) {
strcpy(symbol->errtxt, "Invalid Primary String"); strcpy(symbol->errtxt, "Invalid Primary String");
return ERROR_INVALID_DATA; return ZERROR_INVALID_DATA;
} }
} }
@@ -646,7 +646,7 @@ int maxicode(struct zint_symbol *symbol, unsigned char source[], int length)
} }
i = maxi_text_process(mode, local_source, length); i = maxi_text_process(mode, local_source, length);
if(i == ERROR_TOO_LONG ) { if(i == ZERROR_TOO_LONG ) {
strcpy(symbol->errtxt, "Input data too long"); strcpy(symbol->errtxt, "Input data too long");
return i; return i;
} }