Procházet zdrojové kódy

Don't use UTF-strlen() if the text is not UTF

AnHardt před 9 roky
rodič
revize
54d35230df
1 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 10
    2
      Marlin/ultralcd.cpp

+ 10
- 2
Marlin/ultralcd.cpp Zobrazit soubor

@@ -2481,7 +2481,11 @@ void lcd_init() {
2481 2481
 int lcd_strlen(const char* s) {
2482 2482
   int i = 0, j = 0;
2483 2483
   while (s[i]) {
2484
-    if ((s[i] & 0xc0) != 0x80) j++;
2484
+    #ifdef MAPPER_NON
2485
+      j++;
2486
+    #else
2487
+      if ((s[i] & 0xc0) != 0x80) j++;
2488
+    #endif
2485 2489
     i++;
2486 2490
   }
2487 2491
   return j;
@@ -2490,7 +2494,11 @@ int lcd_strlen(const char* s) {
2490 2494
 int lcd_strlen_P(const char* s) {
2491 2495
   int j = 0;
2492 2496
   while (pgm_read_byte(s)) {
2493
-    if ((pgm_read_byte(s) & 0xc0) != 0x80) j++;
2497
+    #ifdef MAPPER_NON
2498
+      j++; 
2499
+    #else
2500
+      if ((pgm_read_byte(s) & 0xc0) != 0x80) j++;
2501
+    #endif
2494 2502
     s++;
2495 2503
   }
2496 2504
   return j;

Loading…
Zrušit
Uložit