1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-09 04:51:58 +00:00

ERROR_* renamed to ZERROR*

This commit is contained in:
tgotic
2011-01-17 19:25:22 +01:00
parent bba936d514
commit 1807870b97

View File

@@ -47,10 +47,10 @@ int matrix_two_of_five(struct zint_symbol *symbol, unsigned char source[], int l
if(length > 80) { if(length > 80) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -80,10 +80,10 @@ int industrial_two_of_five(struct zint_symbol *symbol, unsigned char source[], i
if(length > 45) { if(length > 45) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid character in data"); strcpy(symbol->errtxt, "Invalid character in data");
return error_number; return error_number;
} }
@@ -112,10 +112,10 @@ int iata_two_of_five(struct zint_symbol *symbol, unsigned char source[], int len
if(length > 45) { if(length > 45) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -145,10 +145,10 @@ int logic_two_of_five(struct zint_symbol *symbol, unsigned char source[], int le
if(length > 80) { if(length > 80) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -183,10 +183,10 @@ int interleaved_two_of_five(struct zint_symbol *symbol, unsigned char source[],
if(length > 89) { if(length > 89) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if (error_number == ERROR_INVALID_DATA) { if (error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -194,7 +194,7 @@ int interleaved_two_of_five(struct zint_symbol *symbol, unsigned char source[],
ustrcpy(temp, (unsigned char *) ""); ustrcpy(temp, (unsigned char *) "");
/* Input must be an even number of characters for Interlaced 2 of 5 to work: /* Input must be an even number of characters for Interlaced 2 of 5 to work:
if an odd number of characters has been entered then add a leading zero */ if an odd number of characters has been entered then add a leading zero */
if ((length % 2) != 0) if (length & 1)
{ {
ustrcpy(temp, (unsigned char *) "0"); ustrcpy(temp, (unsigned char *) "0");
length++; length++;
@@ -244,11 +244,11 @@ int itf14(struct zint_symbol *symbol, unsigned char source[], int length)
if(length > 13) { if(length > 13) {
strcpy(symbol->errtxt, "Input too long"); strcpy(symbol->errtxt, "Input too long");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid character in data"); strcpy(symbol->errtxt, "Invalid character in data");
return error_number; return error_number;
} }
@@ -262,12 +262,10 @@ int itf14(struct zint_symbol *symbol, unsigned char source[], int length)
/* Calculate the check digit - the same method used for EAN-13 */ /* Calculate the check digit - the same method used for EAN-13 */
for (i = 12; i >= 0; i--) for (i = 12; i >= 0; i--) {
{
count += ctoi(localstr[i]); count += ctoi(localstr[i]);
if ((i%2) == 0) if (!(i & 1)) {
{
count += 2 * ctoi(localstr[i]); count += 2 * ctoi(localstr[i]);
} }
} }
@@ -291,10 +289,10 @@ int dpleit(struct zint_symbol *symbol, unsigned char source[], int length)
count = 0; count = 0;
if(length > 13) { if(length > 13) {
strcpy(symbol->errtxt, "Input wrong length"); strcpy(symbol->errtxt, "Input wrong length");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -308,8 +306,7 @@ int dpleit(struct zint_symbol *symbol, unsigned char source[], int length)
{ {
count += 4 * ctoi(localstr[i]); count += 4 * ctoi(localstr[i]);
if (!((i%2) == 0)) if (i & 1) {
{
count += 5 * ctoi(localstr[i]); count += 5 * ctoi(localstr[i]);
} }
} }
@@ -331,10 +328,10 @@ int dpident(struct zint_symbol *symbol, unsigned char source[], int length)
count = 0; count = 0;
if(length > 11) { if(length > 11) {
strcpy(symbol->errtxt, "Input wrong length"); strcpy(symbol->errtxt, "Input wrong length");
return ERROR_TOO_LONG; return ZERROR_TOO_LONG;
} }
error_number = is_sane(NEON, source, length); error_number = is_sane(NEON, source, length);
if(error_number == ERROR_INVALID_DATA) { if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data"); strcpy(symbol->errtxt, "Invalid characters in data");
return error_number; return error_number;
} }
@@ -348,8 +345,7 @@ int dpident(struct zint_symbol *symbol, unsigned char source[], int length)
{ {
count += 4 * ctoi(localstr[i]); count += 4 * ctoi(localstr[i]);
if (!((i%2) == 0)) if (i & 1) {
{
count += 5 * ctoi(localstr[i]); count += 5 * ctoi(localstr[i]);
} }
} }