🩹 Remove poison wchar_t macro

This commit is contained in:
Scott Lahteine
2022-07-01 04:49:37 -05:00
parent 814b53750f
commit 80c7abd727
26 changed files with 244 additions and 239 deletions

View File

@@ -94,12 +94,12 @@ void TFT_String::set() {
* @ displays an axis name such as XYZUVW, or E for an extruder
*/
void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) {
wchar_t wchar;
lchar_t wc;
while (*tpl) {
tpl = get_utf8_value_cb(tpl, read_byte_ram, &wchar);
if (wchar > 255) wchar |= 0x0080;
const uint8_t ch = uint8_t(wchar & 0x00FF);
tpl = get_utf8_value_cb(tpl, read_byte_ram, wc);
if (wc > 255) wc |= 0x0080;
const uint8_t ch = uint8_t(wc & 0x00FF);
if (ch == '=' || ch == '~' || ch == '*') {
if (index >= 0) {
@@ -124,11 +124,11 @@ void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nul
}
void TFT_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) {
wchar_t wchar;
lchar_t wc;
while (*cstr && max_len) {
cstr = get_utf8_value_cb(cstr, read_byte_ram, &wchar);
if (wchar > 255) wchar |= 0x0080;
const uint8_t ch = uint8_t(wchar & 0x00FF);
cstr = get_utf8_value_cb(cstr, read_byte_ram, wc);
if (wc > 255) wc |= 0x0080;
const uint8_t ch = uint8_t(wc & 0x00FF);
add_character(ch);
max_len--;
}