Browse Source

Reference op with variable name

Scott Lahteine 7 years ago
parent
commit
a3645ec921
8 changed files with 38 additions and 38 deletions
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 1
    1
      Marlin/SdBaseFile.cpp
  3. 2
    2
      Marlin/SdBaseFile.h
  4. 1
    1
      Marlin/planner.cpp
  5. 2
    2
      Marlin/ubl_motion.cpp
  6. 14
    14
      Marlin/utility.cpp
  7. 16
    16
      Marlin/utility.h
  8. 1
    1
      Marlin/vector_3.h

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -5881,7 +5881,7 @@ inline void gcode_M17() {
5881 5881
     KEEPALIVE_STATE(IN_HANDLER);
5882 5882
   }
5883 5883
 
5884
-  static void resume_print(const float& load_length = 0, const float& initial_extrude_length = 0, int8_t max_beep_count = 0) {
5884
+  static void resume_print(const float &load_length = 0, const float &initial_extrude_length = 0, int8_t max_beep_count = 0) {
5885 5885
     bool nozzle_timed_out = false;
5886 5886
 
5887 5887
     if (!move_away_flag) return;

+ 1
- 1
Marlin/SdBaseFile.cpp View File

@@ -1819,7 +1819,7 @@ fail:
1819 1819
 //------------------------------------------------------------------------------
1820 1820
 // suppress cpplint warnings with NOLINT comment
1821 1821
 #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
1822
-  void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0;  // NOLINT
1822
+  void (*SdBaseFile::oldDateTime_)(uint16_t &date, uint16_t &time) = 0;  // NOLINT
1823 1823
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1824 1824
 
1825 1825
 

+ 2
- 2
Marlin/SdBaseFile.h View File

@@ -402,7 +402,7 @@ class SdBaseFile {
402 402
    * \param[in] dateTime The user's call back function.
403 403
    */
404 404
   static void dateTimeCallback(
405
-    void (*dateTime)(uint16_t& date, uint16_t& time)) {  // NOLINT
405
+    void (*dateTime)(uint16_t &date, uint16_t &time)) {  // NOLINT
406 406
     oldDateTime_ = dateTime;
407 407
     dateTime_ = dateTime ? oldToNew : 0;
408 408
   }
@@ -477,7 +477,7 @@ class SdBaseFile {
477 477
   //------------------------------------------------------------------------------
478 478
   // rest are private
479 479
  private:
480
-  static void (*oldDateTime_)(uint16_t& date, uint16_t& time);  // NOLINT
480
+  static void (*oldDateTime_)(uint16_t &date, uint16_t &time);  // NOLINT
481 481
   static void oldToNew(uint16_t* date, uint16_t* time) {
482 482
     uint16_t d;
483 483
     uint16_t t;

+ 1
- 1
Marlin/planner.cpp View File

@@ -1510,7 +1510,7 @@ void Planner::sync_from_steppers() {
1510 1510
 /**
1511 1511
  * Setters for planner position (also setting stepper position).
1512 1512
  */
1513
-void Planner::set_position_mm(const AxisEnum axis, const float& v) {
1513
+void Planner::set_position_mm(const AxisEnum axis, const float &v) {
1514 1514
   #if ENABLED(DISTINCT_E_FACTORS)
1515 1515
     const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1516 1516
     last_extruder = active_extruder;

+ 2
- 2
Marlin/ubl_motion.cpp View File

@@ -585,8 +585,8 @@
585 585
       float seg_dest[XYZE];  // per-segment destination, initialize to first segment
586 586
       LOOP_XYZE(i) seg_dest[i] = current_position[i] + segment_distance[i];
587 587
 
588
-      const float& dx_seg = segment_distance[X_AXIS];  // alias for clarity
589
-      const float& dy_seg = segment_distance[Y_AXIS];
588
+      const float &dx_seg = segment_distance[X_AXIS];  // alias for clarity
589
+      const float &dy_seg = segment_distance[Y_AXIS];
590 590
 
591 591
       float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
592 592
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);

+ 14
- 14
Marlin/utility.cpp View File

@@ -57,14 +57,14 @@ void safe_delay(millis_t ms) {
57 57
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
58 58
 
59 59
   // Convert unsigned int to string with 12 format
60
-  char* itostr2(const uint8_t& xx) {
60
+  char* itostr2(const uint8_t &xx) {
61 61
     conv[5] = DIGIMOD(xx, 10);
62 62
     conv[6] = DIGIMOD(xx, 1);
63 63
     return &conv[5];
64 64
   }
65 65
 
66 66
   // Convert signed int to rj string with 123 or -12 format
67
-  char* itostr3(const int& x) {
67
+  char* itostr3(const int &x) {
68 68
     int xx = x;
69 69
     conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
70 70
     conv[5] = RJDIGIT(xx, 10);
@@ -73,7 +73,7 @@ void safe_delay(millis_t ms) {
73 73
   }
74 74
 
75 75
   // Convert unsigned int to lj string with 123 format
76
-  char* itostr3left(const int& xx) {
76
+  char* itostr3left(const int &xx) {
77 77
     char *str = &conv[6];
78 78
     *str = DIGIMOD(xx, 1);
79 79
     if (xx >= 10) {
@@ -85,7 +85,7 @@ void safe_delay(millis_t ms) {
85 85
   }
86 86
 
87 87
   // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format
88
-  char *itostr4sign(const int& x) {
88
+  char *itostr4sign(const int &x) {
89 89
     const bool neg = x < 0;
90 90
     const int xx = neg ? -x : x;
91 91
     if (x >= 1000) {
@@ -116,7 +116,7 @@ void safe_delay(millis_t ms) {
116 116
   }
117 117
 
118 118
   // Convert unsigned float to string with 1.23 format
119
-  char* ftostr12ns(const float& x) {
119
+  char* ftostr12ns(const float &x) {
120 120
     const long xx = (x < 0 ? -x : x) * 100;
121 121
     conv[3] = DIGIMOD(xx, 100);
122 122
     conv[4] = '.';
@@ -126,7 +126,7 @@ void safe_delay(millis_t ms) {
126 126
   }
127 127
 
128 128
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
129
-  char *ftostr32(const float& x) {
129
+  char *ftostr32(const float &x) {
130 130
     long xx = x * 100;
131 131
     conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000));
132 132
     conv[2] = DIGIMOD(xx, 1000);
@@ -140,7 +140,7 @@ void safe_delay(millis_t ms) {
140 140
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
141 141
 
142 142
     // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
143
-    char *ftostr4sign(const float& fx) {
143
+    char *ftostr4sign(const float &fx) {
144 144
       const int x = fx * 10;
145 145
       if (!WITHIN(x, -99, 999)) return itostr4sign((int)fx);
146 146
       const bool neg = x < 0;
@@ -155,7 +155,7 @@ void safe_delay(millis_t ms) {
155 155
   #endif // LCD_DECIMAL_SMALL_XY
156 156
 
157 157
   // Convert float to fixed-length string with +123.4 / -123.4 format
158
-  char* ftostr41sign(const float& x) {
158
+  char* ftostr41sign(const float &x) {
159 159
     int xx = x * 10;
160 160
     conv[1] = MINUSOR(xx, '+');
161 161
     conv[2] = DIGIMOD(xx, 1000);
@@ -167,7 +167,7 @@ void safe_delay(millis_t ms) {
167 167
   }
168 168
 
169 169
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
170
-  char* ftostr43sign(const float& x, char plus/*=' '*/) {
170
+  char* ftostr43sign(const float &x, char plus/*=' '*/) {
171 171
     long xx = x * 1000;
172 172
     conv[1] = xx ? MINUSOR(xx, plus) : ' ';
173 173
     conv[2] = DIGIMOD(xx, 1000);
@@ -179,7 +179,7 @@ void safe_delay(millis_t ms) {
179 179
   }
180 180
 
181 181
   // Convert unsigned float to rj string with 12345 format
182
-  char* ftostr5rj(const float& x) {
182
+  char* ftostr5rj(const float &x) {
183 183
     const long xx = x < 0 ? -x : x;
184 184
     conv[2] = RJDIGIT(xx, 10000);
185 185
     conv[3] = RJDIGIT(xx, 1000);
@@ -190,7 +190,7 @@ void safe_delay(millis_t ms) {
190 190
   }
191 191
 
192 192
   // Convert signed float to string with +1234.5 format
193
-  char* ftostr51sign(const float& x) {
193
+  char* ftostr51sign(const float &x) {
194 194
     long xx = x * 10;
195 195
     conv[0] = MINUSOR(xx, '+');
196 196
     conv[1] = DIGIMOD(xx, 10000);
@@ -203,7 +203,7 @@ void safe_delay(millis_t ms) {
203 203
   }
204 204
 
205 205
   // Convert signed float to string with +123.45 format
206
-  char* ftostr52sign(const float& x) {
206
+  char* ftostr52sign(const float &x) {
207 207
     long xx = x * 100;
208 208
     conv[0] = MINUSOR(xx, '+');
209 209
     conv[1] = DIGIMOD(xx, 10000);
@@ -216,7 +216,7 @@ void safe_delay(millis_t ms) {
216 216
   }
217 217
 
218 218
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
219
-  char* ftostr62rj(const float& x) {
219
+  char* ftostr62rj(const float &x) {
220 220
     const long xx = (x < 0 ? -x : x) * 100;
221 221
     conv[0] = RJDIGIT(xx, 100000);
222 222
     conv[1] = RJDIGIT(xx, 10000);
@@ -229,7 +229,7 @@ void safe_delay(millis_t ms) {
229 229
   }
230 230
 
231 231
   // Convert signed float to space-padded string with -_23.4_ format
232
-  char* ftostr52sp(const float& x) {
232
+  char* ftostr52sp(const float &x) {
233 233
     long xx = x * 100;
234 234
     uint8_t dig;
235 235
     conv[1] = MINUSOR(xx, RJDIGIT(xx, 10000));

+ 16
- 16
Marlin/utility.h View File

@@ -32,53 +32,53 @@ void safe_delay(millis_t ms);
32 32
 #if ENABLED(ULTRA_LCD)
33 33
 
34 34
   // Convert unsigned int to string with 12 format
35
-  char* itostr2(const uint8_t& x);
35
+  char* itostr2(const uint8_t &x);
36 36
 
37 37
   // Convert signed int to rj string with 123 or -12 format
38
-  char* itostr3(const int& x);
38
+  char* itostr3(const int &x);
39 39
 
40 40
   // Convert unsigned int to lj string with 123 format
41
-  char* itostr3left(const int& xx);
41
+  char* itostr3left(const int &xx);
42 42
 
43 43
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
44
-  char *itostr4sign(const int& x);
44
+  char *itostr4sign(const int &x);
45 45
 
46 46
   // Convert unsigned float to string with 1.23 format
47
-  char* ftostr12ns(const float& x);
47
+  char* ftostr12ns(const float &x);
48 48
 
49 49
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
50
-  char *ftostr32(const float& x);
50
+  char *ftostr32(const float &x);
51 51
 
52 52
   // Convert float to fixed-length string with +123.4 / -123.4 format
53
-  char* ftostr41sign(const float& x);
53
+  char* ftostr41sign(const float &x);
54 54
 
55 55
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
56
-  char* ftostr43sign(const float& x, char plus=' ');
56
+  char* ftostr43sign(const float &x, char plus=' ');
57 57
 
58 58
   // Convert unsigned float to rj string with 12345 format
59
-  char* ftostr5rj(const float& x);
59
+  char* ftostr5rj(const float &x);
60 60
 
61 61
   // Convert signed float to string with +1234.5 format
62
-  char* ftostr51sign(const float& x);
62
+  char* ftostr51sign(const float &x);
63 63
 
64 64
   // Convert signed float to space-padded string with -_23.4_ format
65
-  char* ftostr52sp(const float& x);
65
+  char* ftostr52sp(const float &x);
66 66
 
67 67
   // Convert signed float to string with +123.45 format
68
-  char* ftostr52sign(const float& x);
68
+  char* ftostr52sign(const float &x);
69 69
 
70 70
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
71
-  char* ftostr62rj(const float& x);
71
+  char* ftostr62rj(const float &x);
72 72
 
73 73
   // Convert float to rj string with 123 or -12 format
74
-  FORCE_INLINE char *ftostr3(const float& x) { return itostr3((int)x); }
74
+  FORCE_INLINE char *ftostr3(const float &x) { return itostr3((int)x); }
75 75
 
76 76
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
77 77
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
78
-    char *ftostr4sign(const float& fx);
78
+    char *ftostr4sign(const float &fx);
79 79
   #else
80 80
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
81
-    FORCE_INLINE char *ftostr4sign(const float& x) { return itostr4sign((int)x); }
81
+    FORCE_INLINE char *ftostr4sign(const float &x) { return itostr4sign((int)x); }
82 82
   #endif
83 83
 
84 84
 #endif // ULTRA_LCD

+ 1
- 1
Marlin/vector_3.h View File

@@ -77,7 +77,7 @@ struct matrix_3x3 {
77 77
 };
78 78
 
79 79
 
80
-void apply_rotation_xyz(matrix_3x3 rotationMatrix, float& x, float& y, float& z);
80
+void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z);
81 81
 
82 82
 #endif // HAS_ABL
83 83
 #endif // VECTOR_3_H

Loading…
Cancel
Save