ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit e48d88ddf5c0c38fd24167aba4e86e3acc1ab229
parent a82fcd554d47c70610f7af41d4110d97f8c941b0
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sun, 26 Jul 2015 22:28:41 +0200

Remove all string to integer conversions for bits in the loaders as they are now handled in one place

Diffstat:
Msrc/ansilove.c | 28----------------------------
1 file changed, 0 insertions(+), 28 deletions(-)

diff --git a/src/ansilove.c b/src/ansilove.c @@ -210,11 +210,6 @@ void alAnsiLoader(char *input, char *output, char *retinaout, char *font, char * transparent = true; } - // force defaults... exactly now! - if (strcmp(bits, "8") != 0 && strcmp(bits, "9") != 0) { - sprintf(bits, "%s", "8"); - } - // load input file FILE *input_file = fopen(input, "r"); if (input_file == NULL) { @@ -278,7 +273,6 @@ void alAnsiLoader(char *input, char *output, char *retinaout, char *font, char * gdImageColorTransparent(im_Font, 20); // convert numeric command line flags to integer values - int32_t int_bits = atoi(bits); int32_t int_icecolors = atoi(icecolors); // ANSi processing loops @@ -1159,11 +1153,6 @@ void alPcBoardLoader(char *input, char *output, char *retinaout, char *font, cha font_size_y = 16; } - // now set bits to 8 if not already value 8 or 9 - if (strcmp(bits, "8") != 0 && strcmp(bits, "9") != 0) { - sprintf(bits, "%s", "8"); - } - // load input file FILE *input_file = fopen(input, "r"); if (input_file == NULL) { @@ -1197,9 +1186,6 @@ void alPcBoardLoader(char *input, char *output, char *retinaout, char *font, cha // libgd image pointers gdImagePtr im_PCB; - // convert numeric command line flags to integer values - int32_t int_bits = atoi(bits); - // defines for stripping PCBoard codes char *stripped_file_buffer; char **pcbStripCodes; @@ -1552,11 +1538,6 @@ void alBinaryLoader(char *input, char *output, char *retinaout, char *columns, c font_size_y = 16; } - // now set bits to 8 if not already value 8 or 9 - if (strcmp(bits, "8") != 0 && strcmp(bits, "9") != 0) { - sprintf(bits, "%s", "8"); - } - // load input file FILE *input_file = fopen(input, "r"); if (input_file == NULL) { @@ -1592,7 +1573,6 @@ void alBinaryLoader(char *input, char *output, char *retinaout, char *columns, c // convert numeric command line flags to integer values int32_t int_columns = atoi(columns); - int32_t int_bits = atoi(bits); int32_t int_icecolors = atoi(icecolors); // allocate buffer image memory @@ -2150,11 +2130,6 @@ void alTundraLoader(char *input, char *output, char *retinaout, char *font, char font_size_y = 16; } - // now set bits to 8 if not already value 8 or 9 - if (strcmp(bits, "8") != 0 && strcmp(bits, "9") != 0) { - sprintf(bits, "%s", "8"); - } - // load input file FILE *input_file = fopen(input, "r"); if (input_file == NULL) { @@ -2196,9 +2171,6 @@ void alTundraLoader(char *input, char *output, char *retinaout, char *font, char // libgd image pointers gdImagePtr im_Tundra; - // convert numeric command line flags to integer values - int32_t int_bits = atoi(bits); - // extract tundra header tundra_version = input_file_buffer[0]; memcpy(&tundra_header,input_file_buffer+1,8);