mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Resolve further error message and warning idiosyncrasies
This commit is contained in:
parent
baf56daa17
commit
0d4af7a462
@ -1282,25 +1282,36 @@ int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle) {
|
|||||||
|
|
||||||
int ZBarcode_Encode_and_Print(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle) {
|
int ZBarcode_Encode_and_Print(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle) {
|
||||||
int error_number;
|
int error_number;
|
||||||
|
int first_err;
|
||||||
|
|
||||||
error_number = ZBarcode_Encode(symbol, input, length);
|
error_number = ZBarcode_Encode(symbol, input, length);
|
||||||
if (error_number != 0) {
|
if (error_number >= 5) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_err = error_number;
|
||||||
error_number = ZBarcode_Print(symbol, rotate_angle);
|
error_number = ZBarcode_Print(symbol, rotate_angle);
|
||||||
|
if (error_number == 0) {
|
||||||
|
error_number = first_err;
|
||||||
|
}
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle) {
|
int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle) {
|
||||||
int error_number;
|
int error_number;
|
||||||
|
int first_err;
|
||||||
|
|
||||||
error_number = ZBarcode_Encode(symbol, input, length);
|
error_number = ZBarcode_Encode(symbol, input, length);
|
||||||
if (error_number != 0) {
|
if (error_number >= 5) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_err = error_number;
|
||||||
error_number = ZBarcode_Buffer(symbol, rotate_angle);
|
error_number = ZBarcode_Buffer(symbol, rotate_angle);
|
||||||
|
if (error_number == 0) {
|
||||||
|
error_number = first_err;
|
||||||
|
}
|
||||||
|
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1365,24 +1376,38 @@ int ZBarcode_Encode_File(struct zint_symbol *symbol, char *filename) {
|
|||||||
|
|
||||||
int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol, char *filename, int rotate_angle) {
|
int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol, char *filename, int rotate_angle) {
|
||||||
int error_number;
|
int error_number;
|
||||||
|
int first_err;
|
||||||
|
|
||||||
error_number = ZBarcode_Encode_File(symbol, filename);
|
error_number = ZBarcode_Encode_File(symbol, filename);
|
||||||
if (error_number != 0) {
|
if (error_number >= 5) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ZBarcode_Print(symbol, rotate_angle);
|
first_err = error_number;
|
||||||
|
error_number = ZBarcode_Print(symbol, rotate_angle);
|
||||||
|
if (error_number == 0) {
|
||||||
|
error_number = first_err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, int rotate_angle) {
|
int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, int rotate_angle) {
|
||||||
int error_number;
|
int error_number;
|
||||||
|
int first_err;
|
||||||
|
|
||||||
error_number = ZBarcode_Encode_File(symbol, filename);
|
error_number = ZBarcode_Encode_File(symbol, filename);
|
||||||
if (error_number != 0) {
|
if (error_number >= 5) {
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_err = error_number;
|
||||||
|
error_number = ZBarcode_Buffer(symbol, rotate_angle);
|
||||||
|
if (error_number == 0) {
|
||||||
|
error_number = first_err;
|
||||||
|
}
|
||||||
|
|
||||||
return ZBarcode_Buffer(symbol, rotate_angle);
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -279,7 +279,7 @@ namespace Zint {
|
|||||||
strcpy(m_zintSymbol->fgcolour, fgcol.data());
|
strcpy(m_zintSymbol->fgcolour, fgcol.data());
|
||||||
strcpy(m_zintSymbol->bgcolour, bgcol.data());
|
strcpy(m_zintSymbol->bgcolour, bgcol.data());
|
||||||
m_error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0);
|
m_error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0);
|
||||||
if (m_error != 0) {
|
if (m_error >= 5) {
|
||||||
m_lastError = m_zintSymbol->errtxt;
|
m_lastError = m_zintSymbol->errtxt;
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user