Kaynağa Gözat

Fix misc. warnings (#20715)

Dmitry Katsubo 3 yıl önce
ebeveyn
işleme
bbf06152da
No account linked to committer's email address

+ 2
- 3
Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp Dosyayı Görüntüle

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

+ 2
- 3
Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp Dosyayı Görüntüle

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

+ 1
- 2
Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp Dosyayı Görüntüle

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

Loading…
İptal
Kaydet