help the compiler create more efficient code

Patch from Michael <virtual_worlds@gmx.de>
Full text: As usual I have modified only minor things to remove warnigs when compiled as C++ code, have added some const-specifiers where possible to help the compiler create more efficient code and added some static-specifiers to make functions invisible to other modules.
This commit is contained in:
Robin Stuart
2017-05-29 10:43:47 +01:00
parent d08237d06e
commit b3a1b24d18
29 changed files with 275 additions and 298 deletions

View File

@ -56,7 +56,7 @@ static char *TeleTable[] = {
"3113111113", "11311111111111", "331111111111", "111113111113", "31111111111111", "111311111113", "131111111113"
};
int telepen(struct zint_symbol *symbol, unsigned char source[], int src_len) {
int telepen(struct zint_symbol *symbol, unsigned char source[], const size_t src_len) {
unsigned int i, count, check_digit;
int error_number;
char dest[512]; /*14 + 30 * 14 + 14 + 14 + 1 ~ 512 */
@ -103,9 +103,10 @@ int telepen(struct zint_symbol *symbol, unsigned char source[], int src_len) {
return error_number;
}
int telepen_num(struct zint_symbol *symbol, unsigned char source[], int src_len) {
unsigned int i, count, check_digit, glyph;
int error_number, temp_length = src_len;
int telepen_num(struct zint_symbol *symbol, unsigned char source[], const size_t src_len) {
unsigned int count, check_digit, glyph;
int error_number;
size_t i,temp_length = src_len;
char dest[1024]; /* 14 + 60 * 14 + 14 + 14 + 1 ~ 1024 */
unsigned char temp[64];