ansilove

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

commit 2663d4dd56a8f6d842e5625b034f5cfa4a50e5f3
parent 4d56526b03d361847d84079b814df102981b9497
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Tue,  8 Dec 2015 16:08:54 +0100

Convert numeric columns command line flags to integer before calling the binary loader

Diffstat:
Msrc/ansilove.c | 5+----
Msrc/ansilove.h | 2+-
Msrc/main.c | 5++++-
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ansilove.c b/src/ansilove.c @@ -1266,7 +1266,7 @@ void alPcBoardLoader(char *input, char *output, char *retinaout, char *font, int } // BINARY -void alBinaryLoader(char *input, char *output, char *retinaout, char *columns, char *font, int32_t int_bits, bool icecolors, bool createRetinaRep) +void alBinaryLoader(char *input, char *output, char *retinaout, int32_t int_columns, char *font, int32_t int_bits, bool icecolors, bool createRetinaRep) { // some type declarations struct fontStruct fontData; @@ -1306,9 +1306,6 @@ void alBinaryLoader(char *input, char *output, char *retinaout, char *columns, c // libgd image pointers gdImagePtr im_Binary; - - // convert numeric command line flags to integer values - int32_t int_columns = atoi(columns); // allocate buffer image memory im_Binary = gdImageCreate(int_columns * int_bits, diff --git a/src/ansilove.h b/src/ansilove.h @@ -32,7 +32,7 @@ void alDrawChar(gdImagePtr im, const unsigned char *font_data, int32_t int_bits, void alAnsiLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, char *mode, bool icecolors, char *fext, bool createRetinaRep); void alPcBoardLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, bool createRetinaRep); -void alBinaryLoader(char *input, char *output, char *retinaout, char *columns, char *font, int32_t int_bits, bool icecolors, bool createRetinaRep); +void alBinaryLoader(char *input, char *output, char *retinaout, int32_t int_columns, char *font, int32_t int_bits, bool icecolors, bool createRetinaRep); void alArtworxLoader(char *input, char *output, char *retinaout, bool createRetinaRep); void alIcedrawLoader(char *input, char *output, char *retinaout, bool fileHasSAUCE, bool createRetinaRep); void alTundraLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, bool fileHasSAUCE, bool createRetinaRep); diff --git a/src/main.c b/src/main.c @@ -232,6 +232,9 @@ int main(int argc, char *argv[]) columns = "160"; } + // convert numeric command line flags to integer values + int32_t int_columns = atoi(columns); + // default to 80x25 font if font option is not specified if (!font) { font = "80x25"; @@ -249,7 +252,7 @@ int main(int argc, char *argv[]) } else if (!strcmp(fext, ".bin")) { // params: input, output, columns, font, bits, icecolors - alBinaryLoader(input, output, retinaout, columns, font, int_bits, icecolors, createRetinaRep); + alBinaryLoader(input, output, retinaout, int_columns, font, int_bits, icecolors, createRetinaRep); fileIsBinary = true; } else if (!strcmp(fext, ".adf")) {