mingw compile

This commit is contained in:
taipanromania 2008-07-18 14:40:27 +00:00
parent c8e4bbb5b0
commit f44701be48
3 changed files with 39 additions and 39 deletions

View File

@ -48,20 +48,20 @@ int pharma_one(struct zint_symbol *symbol, unsigned char source[])
unsigned long int tester; unsigned long int tester;
int counter; int counter;
char inter[17]; char inter[17];
int errno; int _errno_;
char dest[1000]; char dest[1000];
errno = 0; _errno_ = 0;
strcpy(dest, ""); strcpy(dest, "");
if(strlen(source) > 6) { if(strlen(source) > 6) {
strcpy(symbol->errtxt, "error: input too long"); strcpy(symbol->errtxt, "error: input too long");
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
} }
errno = is_sane(NESET, source); _errno_ = is_sane(NESET, source);
if(errno == ERROR_INVALID_DATA) { if(_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: invalid characters in data"); strcpy(symbol->errtxt, "error: invalid characters in data");
return errno; return _errno_;
} }
strcpy(inter, ""); strcpy(inter, "");
@ -94,7 +94,7 @@ int pharma_one(struct zint_symbol *symbol, unsigned char source[])
expand(symbol, dest); expand(symbol, dest);
strcpy(symbol->text, ""); strcpy(symbol->text, "");
return errno; return _errno_;
} }
int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char dest[]) 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; unsigned long int tester;
int counter; int counter;
char inter[17]; char inter[17];
int errno; int _errno_;
errno = 0; _errno_ = 0;
strcpy(dest, ""); strcpy(dest, "");
strcpy(inter, ""); strcpy(inter, "");
@ -145,7 +145,7 @@ int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char des
} }
dest[strlen(inter)] = '\0'; dest[strlen(inter)] = '\0';
return errno; return _errno_;
} }
int pharma_two(struct zint_symbol *symbol, unsigned char source[]) 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]; char height_pattern[200];
unsigned int loopey; unsigned int loopey;
int writer; int writer;
int errno = 0; int _errno_ = 0;
strcpy(height_pattern, ""); strcpy(height_pattern, "");
if(strlen(source) > 8) { if(strlen(source) > 8) {
strcpy(symbol->errtxt, "error: input too long"); strcpy(symbol->errtxt, "error: input too long");
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
} }
errno = is_sane(NESET, source); _errno_ = is_sane(NESET, source);
if(errno == ERROR_INVALID_DATA) { if(_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: invalid characters in data"); strcpy(symbol->errtxt, "error: invalid characters in data");
return errno; return _errno_;
} }
errno = pharma_two_calc(symbol, source, height_pattern); _errno_ = pharma_two_calc(symbol, source, height_pattern);
if(errno != 0) { if(_errno_ != 0) {
return errno; return _errno_;
} }
writer = 0; writer = 0;
@ -188,16 +188,16 @@ int pharma_two(struct zint_symbol *symbol, unsigned char source[])
symbol->width = writer - 1; symbol->width = writer - 1;
strcpy(symbol->text, ""); strcpy(symbol->text, "");
return errno; return _errno_;
} }
int codabar(struct zint_symbol *symbol, unsigned char source[]) int codabar(struct zint_symbol *symbol, unsigned char source[])
{ /* The Codabar system consisting of simple substitution */ { /* The Codabar system consisting of simple substitution */
int i, errno; int i, _errno_;
char dest[1000]; char dest[1000];
errno = 0; _errno_ = 0;
strcpy(dest, ""); strcpy(dest, "");
if(strlen(source) > 60) { /* No stack smashing please */ 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; return ERROR_TOO_LONG;
} }
to_upper(source); to_upper(source);
errno = is_sane(CASET, source); _errno_ = is_sane(CASET, source);
if(errno == ERROR_INVALID_DATA) { if(_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: invalid characters in 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 */ /* 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); expand(symbol, dest);
strcpy(symbol->text, source); strcpy(symbol->text, source);
return errno; return _errno_;
} }

View File

@ -37,7 +37,7 @@ int ps_plot(struct zint_symbol *symbol)
FILE *feps; FILE *feps;
int fgred, fggrn, fgblu, bgred, bggrn, bgblu; int fgred, fggrn, fgblu, bgred, bggrn, bgblu;
float red_ink, green_ink, blue_ink, red_paper, green_paper, blue_paper; 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; int textoffset, xoffset, yoffset, textdone, main_width;
char textpart[10], addon[6]; char textpart[10], addon[6];
int large_bar_count, comp_offset; 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"); strcpy(symbol->errtxt, "error: malformed background colour target");
return ERROR_INVALID_OPTION; return ERROR_INVALID_OPTION;
} }
errno = is_sane(SSET, symbol->fgcolour); _errno_ = is_sane(SSET, symbol->fgcolour);
if (errno == ERROR_INVALID_DATA) { if (_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: malformed foreground colour target"); strcpy(symbol->errtxt, "error: malformed foreground colour target");
return ERROR_INVALID_OPTION; return ERROR_INVALID_OPTION;
} }
errno = is_sane(SSET, symbol->bgcolour); _errno_ = is_sane(SSET, symbol->bgcolour);
if (errno == ERROR_INVALID_DATA) { if (_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: malformed background colour target"); strcpy(symbol->errtxt, "error: malformed background colour target");
return ERROR_INVALID_OPTION; return ERROR_INVALID_OPTION;
} }
@ -785,6 +785,6 @@ int ps_plot(struct zint_symbol *symbol)
fclose(feps); fclose(feps);
return errno; return _errno_;
} }

View File

@ -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[]) int rss14(struct zint_symbol *symbol, unsigned char source[])
{ /* GS1 DataBar-14 */ { /* 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]; 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_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; 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"); strcpy(symbol->errtxt, "error: input too long");
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
} }
errno = is_sane(NESET, source); _errno_ = is_sane(NESET, source);
if(errno == ERROR_INVALID_DATA) { if(_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: invalid characters in data"); strcpy(symbol->errtxt, "error: invalid characters in data");
return errno; return _errno_;
} }
/* make some room for a separator row for composite symbols */ /* 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[]) int rsslimited(struct zint_symbol *symbol, unsigned char source[])
{ /* GS1 DataBar Limited */ { /* 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]; 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_group, right_group, left_odd, left_even, right_odd, right_even;
int left_character, right_character, left_widths[14], right_widths[14]; 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"); strcpy(symbol->errtxt, "error: input too long");
return ERROR_TOO_LONG; return ERROR_TOO_LONG;
} }
errno = is_sane(NESET, source); _errno_ = is_sane(NESET, source);
if(errno == ERROR_INVALID_DATA) { if(_errno_ == ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "error: invalid characters in data"); strcpy(symbol->errtxt, "error: invalid characters in data");
return errno; return _errno_;
} }
/* make some room for a separator row for composite symbols */ /* 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); concat(symbol->text, hrt);
return errno; return _errno_;
} }
int general_rules(char field[], char type[]) int general_rules(char field[], char type[])