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.
This commit is contained in:
Erik Auerswald
2019-02-03 16:07:14 +01:00
parent d3fdf3b223
commit f17eef899e
+1 -5
View File
@@ -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))) {