From a4dd78018d17b0b98218617baf5d085a89c609d6 Mon Sep 17 00:00:00 2001 From: taipanromania Date: Fri, 3 Oct 2008 08:22:08 +0000 Subject: [PATCH] warnings -- --- backend/medical.c | 14 ++++++++------ backend/plessey.c | 16 +++++++++------- backend/telepen.c | 25 +++++++++++++------------ 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/backend/medical.c b/backend/medical.c index 5c8046ca..589f992a 100644 --- a/backend/medical.c +++ b/backend/medical.c @@ -31,7 +31,9 @@ static char *CodaTable[20] = {"11111221", "11112211", "11121121", "22111111", "11211211", "21111211", "12111121", "12112111", "12211111", "21121111", "11122111", "11221111", "21112121", "21211121", "21212111", "11212121", "11221211", "12121121", "11121221", "11122211"}; - + +int c39(struct zint_symbol *symbol, unsigned char source[]); + int pharma_one(struct zint_symbol *symbol, unsigned char source[]) { /* "Pharmacode can represent only a single integer from 3 to 131070. Unlike other @@ -66,7 +68,7 @@ int pharma_one(struct zint_symbol *symbol, unsigned char source[]) } strcpy(inter, ""); - tester = atoi(source); + tester = atoi((char*)source); if((tester < 3) || (tester > 131070)) { strcpy(symbol->errtxt, "error: data out of range"); @@ -114,7 +116,7 @@ int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], char des strcpy(dest, ""); strcpy(inter, ""); - tester = atoi(source); + tester = atoi((char*)source); if((tester < 4) || (tester > 64570080)) { @@ -233,7 +235,7 @@ int codabar(struct zint_symbol *symbol, unsigned char source[]) } expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -262,7 +264,7 @@ int code32(struct zint_symbol *symbol, unsigned char source[]) for(i = 0; i < zeroes; i++) { concat(localstr, "0"); } - concat(localstr, source); + concat(localstr, (char*)source); /* Calculate the check digit */ checksum = 0; @@ -309,7 +311,7 @@ int code32(struct zint_symbol *symbol, unsigned char source[]) } /* Plot the barcode using Code 39 */ - error_number = c39(symbol, risultante); + error_number = c39(symbol, (unsigned char*)risultante); if(error_number != 0) { return error_number; } /* Override the normal text output with the Pharmacode number */ diff --git a/backend/plessey.c b/backend/plessey.c index a352c22a..a41c22ae 100644 --- a/backend/plessey.c +++ b/backend/plessey.c @@ -93,7 +93,7 @@ int plessey(struct zint_symbol *symbol, unsigned char source[]) concat(dest, "331311313"); expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -129,7 +129,7 @@ int msi_plessey(struct zint_symbol *symbol, unsigned char source[]) concat (dest, "121"); expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -227,7 +227,7 @@ int msi_plessey_mod10(struct zint_symbol *symbol, unsigned char source[]) source[h] = itoc(pump); source[h + 1] = '\0'; expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -382,7 +382,7 @@ int msi_plessey_mod1010(struct zint_symbol *symbol, unsigned char source[]) source[h + 1] = itoc(chwech); source[h + 2] = '\0'; expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -452,7 +452,7 @@ int msi_plessey_mod11(struct zint_symbol *symbol, unsigned char source[]) concat (dest, "121"); expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -578,13 +578,15 @@ int msi_plessey_mod1110(struct zint_symbol *symbol, unsigned char source[]) source[h + 1] = '\0'; expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } int msi_handle(struct zint_symbol *symbol, unsigned char source[]) { int error_number; - + + error_number=0; + if((symbol->option_2 < 0) || (symbol->option_2 > 4)) { symbol->option_2 = 0; } diff --git a/backend/telepen.c b/backend/telepen.c index 0383520d..dc1f36b2 100644 --- a/backend/telepen.c +++ b/backend/telepen.c @@ -91,7 +91,7 @@ int telepen(struct zint_symbol *symbol, unsigned char source[]) concat(dest, TeleTable['z']); expand(symbol, dest); - strcpy(symbol->text, source); + strcpy(symbol->text, (char*)source); return error_number; } @@ -99,12 +99,13 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[]) { unsigned int i, count, check_digit, glyph; int error_number, input_length; - char dest[1000]; - char local_source[100]; + unsigned char dest[1000]; + unsigned char local_source[100]; error_number = 0; - strcpy(dest, ""); - strcpy(local_source, source); + memset(dest, 0, 1000); + memset(local_source, 0, 100); + strcpy((char*)local_source, (char*)source); input_length = ustrlen(source); count = 0; @@ -125,7 +126,7 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[]) { char temp[200]; - strcpy(temp, local_source); + strcpy(temp, (char*)local_source); local_source[0] = '0'; for(i = 0; i <= input_length; i++) @@ -136,7 +137,7 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[]) } /* Start character */ - concat(dest, TeleTable['_']); + concat((char*)dest, TeleTable['_']); for (i=0; i < input_length; i+=2) { @@ -153,17 +154,17 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[]) glyph += 27; count += glyph; } - concat(dest, TeleTable[glyph]); + concat((char*)dest, TeleTable[glyph]); } check_digit = 127 - (count % 127); - concat(dest, TeleTable[check_digit]); + concat((char*)dest, TeleTable[check_digit]); /* Stop character */ - concat(dest, TeleTable['z']); + concat((char*)dest, TeleTable['z']); - expand(symbol, dest); - strcpy(symbol->text, local_source); + expand(symbol, (char*)dest); + strcpy(symbol->text, (char*)local_source); return error_number; }