From f17eef899ea7eb5460e60384adfa9c796653e957 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sun, 3 Feb 2019 16:07:14 +0100 Subject: [PATCH] always use underscore '_' for unknown digits Before, there was a special case where a blank ' ' could be printed if no segments were detected in a digit at all. But this would not happen, since all digits contain at least one pixel which would result in some set segments. This commit is a preparatory step for refactoring segement detection in a digit. --- charset.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/charset.c b/charset.c index 3dcea3d..c40c32f 100644 --- a/charset.c +++ b/charset.c @@ -59,7 +59,6 @@ void init_charset(charset_t cs) } switch(cs) { case CS_FULL: - charset_array[D_UNKNOWN] = ' '; charset_array[D_ZERO] = '0'; charset_array[D_ONE] = '1'; charset_array[D_TWO] = '2'; @@ -90,7 +89,6 @@ void init_charset(charset_t cs) charset_array[D_N] = 'n'; break; case CS_DIGITS: - charset_array[D_UNKNOWN] = ' '; charset_array[D_ZERO] = '0'; charset_array[D_ONE] = '1'; charset_array[D_TWO] = '2'; @@ -106,7 +104,6 @@ void init_charset(charset_t cs) charset_array[D_ALTNINE] = '9'; break; case CS_DECIMAL: - charset_array[D_UNKNOWN] = ' '; charset_array[D_ZERO] = '0'; charset_array[D_ONE] = '1'; charset_array[D_TWO] = '2'; @@ -124,7 +121,6 @@ void init_charset(charset_t cs) charset_array[D_MINUS] = '-'; break; case CS_HEXADECIMAL: - charset_array[D_UNKNOWN] = ' '; charset_array[D_ZERO] = '0'; charset_array[D_ONE] = '1'; charset_array[D_TWO] = '2'; @@ -164,7 +160,7 @@ int print_digit(int digit, unsigned int flags) if(digit <= CHARSET_MAX) { c = charset_array[digit]; } - if(c == '_' || c == ' ') { + if(c == '_') { unknown_digit = 1; } if(!((c == '.') && (flags & OMIT_DECIMAL))) {