ansilove

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

commit 838d9bd5e45f83a1bb48f90aa321cbf6c0aae85b
parent bf47d765c3853e25844423a7747ab9542ead6dec
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 20 Jan 2016 20:50:04 +0100

Using enumeration constants instead of macros to define configuration options

Diffstat:
Msrc/config.h | 6++++--
Msrc/loaders/ansi.c | 4++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/config.h b/src/config.h @@ -15,7 +15,9 @@ // configuration defines #define VERSION "3.0.1" -#define SUBSTITUTE_BREAK "1" -#define WRAP_COLUMN_80 "1" +enum { + SUBSTITUTE_BREAK = 1, + WRAP_COLUMN_80 = 1 +}; #endif diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -116,7 +116,7 @@ void ansi(char *input, char *output, char *retinaout, char *font, int32_t int_bi current_character = input_file_buffer[loop]; next_character = input_file_buffer[loop + 1]; - if (position_x==80 && !strcmp(WRAP_COLUMN_80, "1")) + if (position_x==80 && WRAP_COLUMN_80) { position_y++; position_x=0; @@ -143,7 +143,7 @@ void ansi(char *input, char *output, char *retinaout, char *font, int32_t int_bi } // sub - if (current_character == 26 && !strcmp(SUBSTITUTE_BREAK, "1")) + if (current_character == 26 && SUBSTITUTE_BREAK) { break; }