Skip to content

Commit

Permalink
Remove all string to integer conversions for bits in the loaders as t…
Browse files Browse the repository at this point in the history
…hey are now handled in one place
  • Loading branch information
fcambus committed Jul 26, 2015
1 parent a82fcd5 commit e48d88d
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/ansilove.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e48d88d

Please sign in to comment.