raster.c: need ceilf(large_bar_height * si) to avoid zero height rows;

also improve non-half-int interpolation performance
raster/vector.c: use new stripf() func in "common.c" to workaround gcc
  32-bit float calculation variations
gs1.c: allow dummy AI "[]" if GS1NOCHECK_MODE and has data (#204);
  also add note re TPX AI 235 and terminating FNC1
Remove trailing whitespace in various files
This commit is contained in:
gitlost 2021-09-26 23:55:16 +01:00
parent 9884875fd5
commit eb6e5daa2d
18 changed files with 1255 additions and 1081 deletions

View file

@ -129,6 +129,18 @@ INTERNAL void lookup(const char set_string[], const char *table[], const char da
}
}
/* Returns the position of data in set_string */
INTERNAL int posn(const char set_string[], const char data) {
int i, n = (int) strlen(set_string);
for (i = 0; i < n; i++) {
if (data == set_string[i]) {
return i;
}
}
return -1;
}
/* Convert an integer value to a string representing its binary equivalent */
INTERNAL void bin_append(const int arg, const int length, char *binary) {
int bin_posn = (int) strlen(binary);
@ -155,18 +167,6 @@ INTERNAL int bin_append_posn(const int arg, const int length, char *binary, cons
return bin_posn + length;
}
/* Returns the position of data in set_string */
INTERNAL int posn(const char set_string[], const char data) {
int i, n = (int) strlen(set_string);
for (i = 0; i < n; i++) {
if (data == set_string[i]) {
return i;
}
}
return -1;
}
#ifndef COMMON_INLINE
/* Return true (1) if a module is dark/black, otherwise false (0) */
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
@ -435,6 +435,11 @@ INTERNAL int set_height(struct zint_symbol *symbol, const float min_row_height,
return error_number;
}
/* Removes excess precision from floats - see https://stackoverflow.com/q/503436/664741 */
INTERNAL float stripf(const float arg) {
return *((volatile const float *) &arg);
}
/* Returns red component if any of ultra colour indexing "0CBMRYGKW" */
INTERNAL int colour_to_red(const int colour) {
int return_val = 0;