diff --git a/backend/medical.c b/backend/medical.c index ce891b44..cb989677 100644 --- a/backend/medical.c +++ b/backend/medical.c @@ -48,20 +48,20 @@ int pharma_one(struct zint_symbol *symbol, unsigned char source[]) unsigned long int tester; int counter; char inter[17]; - int errno; + int _errno_; char dest[1000]; - errno = 0; + _errno_ = 0; strcpy(dest, ""); if(strlen(source) > 6) { strcpy(symbol->errtxt, "error: input too long"); return ERROR_TOO_LONG; } - errno = is_sane(NESET, source); - if(errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(NESET, source); + if(_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: invalid characters in data"); - return errno; + return _errno_; } strcpy(inter, ""); @@ -94,7 +94,7 @@ int pharma_one(struct zint_symbol *symbol, unsigned char source[]) expand(symbol, dest); strcpy(symbol->text, ""); - return errno; + return _errno_; } int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char dest[]) @@ -107,9 +107,9 @@ int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char des unsigned long int tester; int counter; char inter[17]; - int errno; + int _errno_; - errno = 0; + _errno_ = 0; strcpy(dest, ""); strcpy(inter, ""); @@ -145,7 +145,7 @@ int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char des } dest[strlen(inter)] = '\0'; - return errno; + return _errno_; } int pharma_two(struct zint_symbol *symbol, unsigned char source[]) @@ -154,21 +154,21 @@ int pharma_two(struct zint_symbol *symbol, unsigned char source[]) char height_pattern[200]; unsigned int loopey; int writer; - int errno = 0; + int _errno_ = 0; strcpy(height_pattern, ""); if(strlen(source) > 8) { strcpy(symbol->errtxt, "error: input too long"); return ERROR_TOO_LONG; } - errno = is_sane(NESET, source); - if(errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(NESET, source); + if(_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: invalid characters in data"); - return errno; + return _errno_; } - errno = pharma_two_calc(symbol, source, height_pattern); - if(errno != 0) { - return errno; + _errno_ = pharma_two_calc(symbol, source, height_pattern); + if(_errno_ != 0) { + return _errno_; } writer = 0; @@ -188,16 +188,16 @@ int pharma_two(struct zint_symbol *symbol, unsigned char source[]) symbol->width = writer - 1; strcpy(symbol->text, ""); - return errno; + return _errno_; } int codabar(struct zint_symbol *symbol, unsigned char source[]) { /* The Codabar system consisting of simple substitution */ - int i, errno; + int i, _errno_; char dest[1000]; - errno = 0; + _errno_ = 0; strcpy(dest, ""); if(strlen(source) > 60) { /* No stack smashing please */ @@ -205,10 +205,10 @@ int codabar(struct zint_symbol *symbol, unsigned char source[]) return ERROR_TOO_LONG; } to_upper(source); - errno = is_sane(CASET, source); - if(errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(CASET, source); + if(_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: invalid characters in data"); - return errno; + return _errno_; } /* Codabar must begin and end with the characters A, B, C or D */ @@ -233,5 +233,5 @@ int codabar(struct zint_symbol *symbol, unsigned char source[]) expand(symbol, dest); strcpy(symbol->text, source); - return errno; + return _errno_; } diff --git a/backend/ps.c b/backend/ps.c index cdeb6934..e7720dd5 100644 --- a/backend/ps.c +++ b/backend/ps.c @@ -37,7 +37,7 @@ int ps_plot(struct zint_symbol *symbol) FILE *feps; int fgred, fggrn, fgblu, bgred, bggrn, bgblu; float red_ink, green_ink, blue_ink, red_paper, green_paper, blue_paper; - int errno = 0; + int _errno_ = 0; int textoffset, xoffset, yoffset, textdone, main_width; char textpart[10], addon[6]; int large_bar_count, comp_offset; @@ -67,13 +67,13 @@ int ps_plot(struct zint_symbol *symbol) strcpy(symbol->errtxt, "error: malformed background colour target"); return ERROR_INVALID_OPTION; } - errno = is_sane(SSET, symbol->fgcolour); - if (errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(SSET, symbol->fgcolour); + if (_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: malformed foreground colour target"); return ERROR_INVALID_OPTION; } - errno = is_sane(SSET, symbol->bgcolour); - if (errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(SSET, symbol->bgcolour); + if (_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: malformed background colour target"); return ERROR_INVALID_OPTION; } @@ -785,6 +785,6 @@ int ps_plot(struct zint_symbol *symbol) fclose(feps); - return errno; + return _errno_; } diff --git a/backend/rss.c b/backend/rss.c index e391e2cb..8595b93e 100644 --- a/backend/rss.c +++ b/backend/rss.c @@ -141,7 +141,7 @@ void getRSSwidths(int val, int n, int elements, int maxWidth, int noNarrow) int rss14(struct zint_symbol *symbol, unsigned char source[]) { /* GS1 DataBar-14 */ - int errno = 0, i, j, read, mask; + int _errno_ = 0, i, j, read, mask; short int accum[112], left_reg[112], right_reg[112], x_reg[112], y_reg[112]; int data_character[4], data_group[4], v_odd[4], v_even[4]; int data_widths[8][4], checksum, c_left, c_right, total_widths[46], writer; @@ -154,10 +154,10 @@ int rss14(struct zint_symbol *symbol, unsigned char source[]) strcpy(symbol->errtxt, "error: input too long"); return ERROR_TOO_LONG; } - errno = is_sane(NESET, source); - if(errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(NESET, source); + if(_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: invalid characters in data"); - return errno; + return _errno_; } /* make some room for a separator row for composite symbols */ @@ -632,12 +632,12 @@ int rss14(struct zint_symbol *symbol, unsigned char source[]) } - return errno; + return _errno_; } int rsslimited(struct zint_symbol *symbol, unsigned char source[]) { /* GS1 DataBar Limited */ - int errno = 0, i, mask; + int _errno_ = 0, i, mask; short int accum[112], left_reg[112], right_reg[112], x_reg[112], y_reg[112]; int left_group, right_group, left_odd, left_even, right_odd, right_even; int left_character, right_character, left_widths[14], right_widths[14]; @@ -651,10 +651,10 @@ int rsslimited(struct zint_symbol *symbol, unsigned char source[]) strcpy(symbol->errtxt, "error: input too long"); return ERROR_TOO_LONG; } - errno = is_sane(NESET, source); - if(errno == ERROR_INVALID_DATA) { + _errno_ = is_sane(NESET, source); + if(_errno_ == ERROR_INVALID_DATA) { strcpy(symbol->errtxt, "error: invalid characters in data"); - return errno; + return _errno_; } /* make some room for a separator row for composite symbols */ @@ -898,7 +898,7 @@ int rsslimited(struct zint_symbol *symbol, unsigned char source[]) concat(symbol->text, hrt); - return errno; + return _errno_; } int general_rules(char field[], char type[])