From 9bc79e4ecfbd23260110d9fb5345075a6ebc1d5d Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 21 Jun 2009 19:05:26 +0300 Subject: [PATCH] dump: Define DUMP_COLOR_MODE_NONE --- src/viewer/dump/dump-color-mode.h | 3 ++- src/viewer/dump/dump-specialized.h | 7 ++++--- src/viewer/dump/dump.c | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/viewer/dump/dump-color-mode.h b/src/viewer/dump/dump-color-mode.h index 07a66d8ee..c0c472db9 100644 --- a/src/viewer/dump/dump-color-mode.h +++ b/src/viewer/dump/dump-color-mode.h @@ -14,8 +14,9 @@ * (The function names could be generated with the ## preprocessor * operator, but that would make grepping more difficult.) * - * At most one of the following macros may be defined: + * One of the following macros must be defined: * + * - DUMP_COLOR_MODE_NONE * - DUMP_COLOR_MODE_16 * - DUMP_COLOR_MODE_256 * - DUMP_COLOR_MODE_TRUE diff --git a/src/viewer/dump/dump-specialized.h b/src/viewer/dump/dump-specialized.h index 3c808d627..d2550caab 100644 --- a/src/viewer/dump/dump-specialized.h +++ b/src/viewer/dump/dump-specialized.h @@ -11,8 +11,9 @@ * - DUMP_FUNCTION_SPECIALIZED: The name of the function that this * file should define. * - * At most one of the following macros may be defined: + * One of the following macros must be defined: * + * - DUMP_COLOR_MODE_NONE * - DUMP_COLOR_MODE_16 * - DUMP_COLOR_MODE_256 * - DUMP_COLOR_MODE_TRUE @@ -158,12 +159,12 @@ DUMP_FUNCTION_SPECIALIZED(struct document *document, struct dump_output *out) #endif /* !DUMP_CHARSET_UTF8 */ } -#if defined(DUMP_COLOR_MODE_16) || defined(DUMP_COLOR_MODE_256) || defined(DUMP_COLOR_MODE_TRUE) +#ifndef DUMP_COLOR_MODE_NONE for (;x < width; x++) { if (write_char(' ', out)) return -1; } -#endif /* DUMP_COLOR_MODE_16 || DUMP_COLOR_MODE_256 || DUMP_COLOR_MODE_TRUE */ +#endif /* !DUMP_COLOR_MODE_NONE */ /* Print end of line. */ if (write_char('\n', out)) diff --git a/src/viewer/dump/dump.c b/src/viewer/dump/dump.c index 7bd454efe..7118c0219 100644 --- a/src/viewer/dump/dump.c +++ b/src/viewer/dump/dump.c @@ -228,10 +228,12 @@ write_true_color(const unsigned char *str, const unsigned char *color, #endif /* CONFIG_TRUE_COLOR */ +#define DUMP_COLOR_MODE_NONE #define DUMP_FUNCTION_COLOR dump_nocolor #define DUMP_FUNCTION_UTF8 dump_nocolor_utf8 #define DUMP_FUNCTION_UNIBYTE dump_nocolor_unibyte #include "dump-color-mode.h" +#undef DUMP_COLOR_MODE_NONE #undef DUMP_FUNCTION_COLOR #undef DUMP_FUNCTION_UTF8 #undef DUMP_FUNCTION_UNIBYTE