Browse Source

Fix for a few -Wextra warnings.

daid303 12 years ago
parent
commit
43018a48c4
3 changed files with 18 additions and 14 deletions
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 9
    9
      Marlin/Sd2Card.cpp
  3. 8
    4
      Marlin/cardreader.cpp

+ 1
- 1
Marlin/Marlin_main.cpp View File

1753
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
1753
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
1754
   LCD_ALERTMESSAGEPGM(MSG_KILLED);
1754
   LCD_ALERTMESSAGEPGM(MSG_KILLED);
1755
   suicide();
1755
   suicide();
1756
-  while(1); // Wait for reset
1756
+  while(1) { /* Intentionally left empty */ } // Wait for reset
1757
 }
1757
 }
1758
 
1758
 
1759
 void Stop()
1759
 void Stop()

+ 9
- 9
Marlin/Sd2Card.cpp View File

42
 /** SPI receive a byte */
42
 /** SPI receive a byte */
43
 static uint8_t spiRec() {
43
 static uint8_t spiRec() {
44
   SPDR = 0XFF;
44
   SPDR = 0XFF;
45
-  while (!(SPSR & (1 << SPIF)));
45
+  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
46
   return SPDR;
46
   return SPDR;
47
 }
47
 }
48
 //------------------------------------------------------------------------------
48
 //------------------------------------------------------------------------------
49
 /** SPI read data - only one call so force inline */
49
 /** SPI read data - only one call so force inline */
50
 static inline __attribute__((always_inline))
50
 static inline __attribute__((always_inline))
51
-  void spiRead(uint8_t* buf, uint16_t nbyte) {
51
+void spiRead(uint8_t* buf, uint16_t nbyte) {
52
   if (nbyte-- == 0) return;
52
   if (nbyte-- == 0) return;
53
   SPDR = 0XFF;
53
   SPDR = 0XFF;
54
   for (uint16_t i = 0; i < nbyte; i++) {
54
   for (uint16_t i = 0; i < nbyte; i++) {
55
-    while (!(SPSR & (1 << SPIF)));
55
+    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
56
     buf[i] = SPDR;
56
     buf[i] = SPDR;
57
     SPDR = 0XFF;
57
     SPDR = 0XFF;
58
   }
58
   }
59
-  while (!(SPSR & (1 << SPIF)));
59
+  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
60
   buf[nbyte] = SPDR;
60
   buf[nbyte] = SPDR;
61
 }
61
 }
62
 //------------------------------------------------------------------------------
62
 //------------------------------------------------------------------------------
63
 /** SPI send a byte */
63
 /** SPI send a byte */
64
 static void spiSend(uint8_t b) {
64
 static void spiSend(uint8_t b) {
65
   SPDR = b;
65
   SPDR = b;
66
-  while (!(SPSR & (1 << SPIF)));
66
+  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
67
 }
67
 }
68
 //------------------------------------------------------------------------------
68
 //------------------------------------------------------------------------------
69
 /** SPI send block - only one call so force inline */
69
 /** SPI send block - only one call so force inline */
71
   void spiSendBlock(uint8_t token, const uint8_t* buf) {
71
   void spiSendBlock(uint8_t token, const uint8_t* buf) {
72
   SPDR = token;
72
   SPDR = token;
73
   for (uint16_t i = 0; i < 512; i += 2) {
73
   for (uint16_t i = 0; i < 512; i += 2) {
74
-    while (!(SPSR & (1 << SPIF)));
74
+    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
75
     SPDR = buf[i];
75
     SPDR = buf[i];
76
-    while (!(SPSR & (1 << SPIF)));
76
+    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
77
     SPDR = buf[i + 1];
77
     SPDR = buf[i + 1];
78
   }
78
   }
79
-  while (!(SPSR & (1 << SPIF)));
79
+  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
80
 }
80
 }
81
 //------------------------------------------------------------------------------
81
 //------------------------------------------------------------------------------
82
 #else  // SOFTWARE_SPI
82
 #else  // SOFTWARE_SPI
174
   if (cmd == CMD12) spiRec();
174
   if (cmd == CMD12) spiRec();
175
 
175
 
176
   // wait for response
176
   // wait for response
177
-  for (uint8_t i = 0; ((status_ = spiRec()) & 0X80) && i != 0XFF; i++);
177
+  for (uint8_t i = 0; ((status_ = spiRec()) & 0X80) && i != 0XFF; i++) { /* Intentionally left empty */ }
178
   return status_;
178
   return status_;
179
 }
179
 }
180
 //------------------------------------------------------------------------------
180
 //------------------------------------------------------------------------------

+ 8
- 4
Marlin/cardreader.cpp View File

245
           SERIAL_PROTOCOLLNPGM(".");
245
           SERIAL_PROTOCOLLNPGM(".");
246
           return;
246
           return;
247
         }
247
         }
248
-        else
249
-          ;//SERIAL_ECHOLN("dive ok");
248
+        else
249
+        {
250
+          //SERIAL_ECHOLN("dive ok");
251
+        }
250
           
252
           
251
         curDir=&myDir; 
253
         curDir=&myDir; 
252
         dirname_start=dirname_end+1;
254
         dirname_start=dirname_end+1;
339
           SERIAL_PROTOCOLLNPGM(".");
341
           SERIAL_PROTOCOLLNPGM(".");
340
           return;
342
           return;
341
         }
343
         }
342
-        else
343
-          ;//SERIAL_ECHOLN("dive ok");
344
+        else
345
+        {
346
+          //SERIAL_ECHOLN("dive ok");
347
+        }
344
           
348
           
345
         curDir=&myDir; 
349
         curDir=&myDir; 
346
         dirname_start=dirname_end+1;
350
         dirname_start=dirname_end+1;

Loading…
Cancel
Save