X-Git-Url: http://git.refcnt.org/?a=blobdiff_plain;f=colorize.c;h=ff346b0c25e35bacd3707f1d8b784b57e004d0fb;hb=7ee1a09534edb8d84d3172413066d7a76edd0291;hp=7c1b6480da59062795ab7c40860b04ddc809141a;hpb=2d7ae2f7a5858e02a378d62142d65c4ff975859b;p=colorize.git diff --git a/colorize.c b/colorize.c index 7c1b648..ff346b0 100644 --- a/colorize.c +++ b/colorize.c @@ -116,9 +116,11 @@ # define COLOR_SEP_CHAR '/' #endif -#define DEBUG_FILE "debug.txt" +#if DEBUG +# define DEBUG_FILE "debug.txt" +#endif -#define MAX_ATTRIBUTE_CHARS (5 * 2) +#define MAX_ATTRIBUTE_CHARS (6 * 2) #define VERSION "0.62" @@ -164,7 +166,7 @@ struct bytes_size { char unit; }; -enum fmts { +enum { FMT_GENERIC, FMT_STRING, FMT_QUOTE, @@ -188,7 +190,7 @@ static const char *formats[] = { enum { GENERIC, FOREGROUND = 0, BACKGROUND }; static const struct { - struct color const *entries; + const struct color *entries; unsigned int count; const char *desc; } tables[] = { @@ -702,6 +704,7 @@ process_args (unsigned int arg_cnt, char **arg_strings, char *attr, const struct color_name.name = color_name.orig = "default"; find_color_entry (&color_name, FOREGROUND, colors); + assert (colors[FOREGROUND]->code != NULL); } process_file_arg (file_string, file, stream);