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

@ -291,9 +291,10 @@ void c128_set_c(unsigned char source_a, unsigned char source_b, char dest[], int
}
/* Handle Code 128 and NVE-18 */
int code_128(struct zint_symbol *symbol, unsigned char source[], int length) {
int code_128(struct zint_symbol *symbol, unsigned char source[], const size_t length) {
int i, j, k, values[170] = {0}, bar_characters, read, total_sum;
int error_number, indexchaine, indexliste, sourcelen, f_state;
int error_number, indexchaine, indexliste, f_state;
size_t sourcelen;
char set[170] = {' '}, fset[170] = {' '}, mode, last_set, current_set = ' ';
float glyph_count;
char dest[1000];