CODE39/PLESSEY/POSTNET/PLANET/TELEPEN: suppress MSVC6 warning C4761

(`hrt_cat_chr_nochk(`))
This commit is contained in:
gitlost 2025-02-24 18:12:12 +00:00
parent d9aebc1c72
commit f747de3684
4 changed files with 14 additions and 11 deletions

View file

@ -211,18 +211,21 @@ INTERNAL int code39(struct zint_symbol *symbol, unsigned char source[], int leng
(void) set_height(symbol, 0.0f, 50.f, 0.0f, 1 /*no_errtxt*/);
}
/* Display a space check digit as _, otherwise it looks like an error */
if (symbol->option_2 == 1 && !raw_text && check_digit == ' ') {
check_digit = '_';
}
if (symbol->symbology == BARCODE_CODE39 && !raw_text) {
hrt_cpy_chr(symbol, '*');
hrt_cat_nochk(symbol, source, length);
if (symbol->option_2 == 1) { /* Visible check digit */
/* Display a space check digit as _, otherwise it looks like an error */
hrt_cat_chr_nochk(symbol, check_digit == ' ' ? '_' : check_digit);
hrt_cat_chr_nochk(symbol, check_digit);
}
hrt_cat_chr_nochk(symbol, '*');
} else {
hrt_cpy_nochk(symbol, source, length);
if (symbol->option_2 == 1 || (raw_text && check_digit)) {
hrt_cat_chr_nochk(symbol, !raw_text && check_digit == ' ' ? '_' : check_digit);
hrt_cat_chr_nochk(symbol, check_digit);
}
}
return error_number;

View file

@ -118,10 +118,10 @@ INTERNAL int plessey(struct zint_symbol *symbol, unsigned char source[], int len
hrt_cpy_nochk(symbol, source, length);
if (symbol->option_2 == 1 || raw_text) {
const unsigned c1 = check_digits & 0xF;
const unsigned c2 = check_digits >> 4;
hrt_cat_chr_nochk(symbol, xtoc(c1));
hrt_cat_chr_nochk(symbol, xtoc(c2));
const unsigned int c1 = check_digits & 0xF;
const unsigned int c2 = check_digits >> 4;
hrt_cat_chr_nochk(symbol, (char) xtoc(c1));
hrt_cat_chr_nochk(symbol, (char) xtoc(c2));
}
return error_number;

View file

@ -184,7 +184,7 @@ static int postnet_enc(struct zint_symbol *symbol, const unsigned char source[],
if (raw_text) {
hrt_cpy_nochk(symbol, source, length);
hrt_cat_chr_nochk(symbol, check_digit + '0');
hrt_cat_chr_nochk(symbol, (char) itoc(check_digit));
}
return error_number;
@ -258,7 +258,7 @@ static int planet_enc(struct zint_symbol *symbol, const unsigned char source[],
if (raw_text) {
hrt_cpy_nochk(symbol, source, length);
hrt_cat_chr_nochk(symbol, check_digit + '0');
hrt_cat_chr_nochk(symbol, (char) itoc(check_digit));
}
return error_number;

View file

@ -140,7 +140,7 @@ INTERNAL int telepen(struct zint_symbol *symbol, unsigned char source[], int len
hrt_cpy_iso8859_1(symbol, source, length);
if (raw_text) {
hrt_cat_chr_nochk(symbol, check_digit);
hrt_cat_chr_nochk(symbol, (char) check_digit);
}
return error_number;
@ -219,7 +219,7 @@ INTERNAL int telepen_num(struct zint_symbol *symbol, unsigned char source[], int
hrt_cpy_nochk(symbol, local_source, length);
if (raw_text) {
hrt_cat_chr_nochk(symbol, check_digit);
hrt_cat_chr_nochk(symbol, (char) check_digit);
}
return error_number;