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
     KEEPALIVE_STATE(IN_HANDLER);
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
     bool nozzle_timed_out = false;
5885
     bool nozzle_timed_out = false;
5886
 
5886
 
5887
     if (!move_away_flag) return;
5887
     if (!move_away_flag) return;

+ 1
- 1
Marlin/SdBaseFile.cpp View File

1819
 //------------------------------------------------------------------------------
1819
 //------------------------------------------------------------------------------
1820
 // suppress cpplint warnings with NOLINT comment
1820
 // suppress cpplint warnings with NOLINT comment
1821
 #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
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
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1823
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1824
 
1824
 
1825
 
1825
 

+ 2
- 2
Marlin/SdBaseFile.h View File

402
    * \param[in] dateTime The user's call back function.
402
    * \param[in] dateTime The user's call back function.
403
    */
403
    */
404
   static void dateTimeCallback(
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
     oldDateTime_ = dateTime;
406
     oldDateTime_ = dateTime;
407
     dateTime_ = dateTime ? oldToNew : 0;
407
     dateTime_ = dateTime ? oldToNew : 0;
408
   }
408
   }
477
   //------------------------------------------------------------------------------
477
   //------------------------------------------------------------------------------
478
   // rest are private
478
   // rest are private
479
  private:
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
   static void oldToNew(uint16_t* date, uint16_t* time) {
481
   static void oldToNew(uint16_t* date, uint16_t* time) {
482
     uint16_t d;
482
     uint16_t d;
483
     uint16_t t;
483
     uint16_t t;

+ 1
- 1
Marlin/planner.cpp View File

1510
 /**
1510
 /**
1511
  * Setters for planner position (also setting stepper position).
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
   #if ENABLED(DISTINCT_E_FACTORS)
1514
   #if ENABLED(DISTINCT_E_FACTORS)
1515
     const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1515
     const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1516
     last_extruder = active_extruder;
1516
     last_extruder = active_extruder;

+ 2
- 2
Marlin/ubl_motion.cpp View File

585
       float seg_dest[XYZE];  // per-segment destination, initialize to first segment
585
       float seg_dest[XYZE];  // per-segment destination, initialize to first segment
586
       LOOP_XYZE(i) seg_dest[i] = current_position[i] + segment_distance[i];
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
       float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
591
       float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
592
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
592
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);

+ 14
- 14
Marlin/utility.cpp View File

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

+ 16
- 16
Marlin/utility.h View File

32
 #if ENABLED(ULTRA_LCD)
32
 #if ENABLED(ULTRA_LCD)
33
 
33
 
34
   // Convert unsigned int to string with 12 format
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
   // Convert signed int to rj string with 123 or -12 format
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
   // Convert unsigned int to lj string with 123 format
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
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
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
   // Convert unsigned float to string with 1.23 format
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
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
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
   // Convert float to fixed-length string with +123.4 / -123.4 format
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
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
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
   // Convert unsigned float to rj string with 12345 format
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
   // Convert signed float to string with +1234.5 format
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
   // Convert signed float to space-padded string with -_23.4_ format
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
   // Convert signed float to string with +123.45 format
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
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
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
   // Convert float to rj string with 123 or -12 format
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
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
76
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
77
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
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
   #else
79
   #else
80
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
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
   #endif
82
   #endif
83
 
83
 
84
 #endif // ULTRA_LCD
84
 #endif // ULTRA_LCD

+ 1
- 1
Marlin/vector_3.h View File

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
 #endif // HAS_ABL
82
 #endif // HAS_ABL
83
 #endif // VECTOR_3_H
83
 #endif // VECTOR_3_H

Loading…
Cancel
Save