Browse Source

Fix misc. warnings (#20715)

Dmitry Katsubo 3 years ago
parent
commit
bbf06152da
No account linked to committer's email address

+ 2
- 3
Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp View File

43
 }
43
 }
44
 
44
 
45
 UnwResult UnwStartArm(UnwState * const state) {
45
 UnwResult UnwStartArm(UnwState * const state) {
46
-  bool found = false;
47
   uint16_t   t = UNW_MAX_INSTR_COUNT;
46
   uint16_t   t = UNW_MAX_INSTR_COUNT;
48
 
47
 
49
-  do {
48
+  for (;;) {
50
     uint32_t instr;
49
     uint32_t instr;
51
 
50
 
52
     /* Attempt to read the instruction */
51
     /* Attempt to read the instruction */
527
 
526
 
528
     if (--t == 0) return UNWIND_EXHAUSTED;
527
     if (--t == 0) return UNWIND_EXHAUSTED;
529
 
528
 
530
-  } while (!found);
529
+  }
531
 
530
 
532
   return UNWIND_UNSUPPORTED;
531
   return UNWIND_UNSUPPORTED;
533
 }
532
 }

+ 2
- 3
Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp View File

30
 }
30
 }
31
 
31
 
32
 UnwResult UnwStartThumb(UnwState * const state) {
32
 UnwResult UnwStartThumb(UnwState * const state) {
33
-  bool found = false;
34
   uint16_t t = UNW_MAX_INSTR_COUNT;
33
   uint16_t t = UNW_MAX_INSTR_COUNT;
35
   uint32_t lastJumpAddr = 0;  // Last JUMP address, to try to detect infinite loops
34
   uint32_t lastJumpAddr = 0;  // Last JUMP address, to try to detect infinite loops
36
   bool loopDetected = false;  // If a loop was detected
35
   bool loopDetected = false;  // If a loop was detected
37
 
36
 
38
-  do {
37
+  for (;;) {
39
     uint16_t instr;
38
     uint16_t instr;
40
 
39
 
41
     /* Attempt to read the instruction */
40
     /* Attempt to read the instruction */
1059
 
1058
 
1060
     if (--t == 0) return UNWIND_EXHAUSTED;
1059
     if (--t == 0) return UNWIND_EXHAUSTED;
1061
 
1060
 
1062
-  } while (!found);
1061
+  }
1063
 
1062
 
1064
   return UNWIND_SUCCESS;
1063
   return UNWIND_SUCCESS;
1065
 }
1064
 }

+ 1
- 2
Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp View File

245
 
245
 
246
 uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_seq) {
246
 uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_seq) {
247
   uint8_t is_escape = 0;
247
   uint8_t is_escape = 0;
248
-  uint8_t value;
249
   for (;;) {
248
   for (;;) {
250
-    value = u8g_pgm_read(esc_seq);
249
+    uint8_t value = u8g_pgm_read(esc_seq);
251
     if (is_escape == 0) {
250
     if (is_escape == 0) {
252
       if (value != 255) {
251
       if (value != 255) {
253
         if (u8g_WriteByte(u8g, dev, value) == 0 )
252
         if (u8g_WriteByte(u8g, dev, value) == 0 )

Loading…
Cancel
Save