Przeglądaj źródła

Use const arguments in Dual X helper functions

Scott Lahteine 8 lat temu
rodzic
commit
fe96f74db1
1 zmienionych plików z 2 dodań i 4 usunięć
  1. 2
    4
      Marlin/Marlin_main.cpp

+ 2
- 4
Marlin/Marlin_main.cpp Wyświetl plik

1312
 
1312
 
1313
   static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
1313
   static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
1314
 
1314
 
1315
-  static float x_home_pos(int extruder) {
1315
+  static float x_home_pos(const int extruder) {
1316
     if (extruder == 0)
1316
     if (extruder == 0)
1317
       return LOGICAL_X_POSITION(base_home_pos(X_AXIS));
1317
       return LOGICAL_X_POSITION(base_home_pos(X_AXIS));
1318
     else
1318
     else
1325
       return LOGICAL_X_POSITION(hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS);
1325
       return LOGICAL_X_POSITION(hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS);
1326
   }
1326
   }
1327
 
1327
 
1328
-  static int x_home_dir(int extruder) {
1329
-    return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
1330
-  }
1328
+  static int x_home_dir(const int extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; }
1331
 
1329
 
1332
   static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
1330
   static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
1333
   static bool active_extruder_parked = false;        // used in mode 1 & 2
1331
   static bool active_extruder_parked = false;        // used in mode 1 & 2

Ładowanie…
Anuluj
Zapisz