Apply loop shorthand macros (#17159)

This commit is contained in:
Scott Lahteine
2020-03-13 23:18:16 -05:00
committed by GitHub
parent a96be32fae
commit 118bd2f8b2
93 changed files with 465 additions and 505 deletions

View File

@ -237,7 +237,7 @@ public:
if (!var.memadr) return;
union { unsigned char tmp[sizeof(T)]; T t; } x;
unsigned char *ptr = (unsigned char*)val_ptr;
for (uint8_t i = 0; i < sizeof(T); i++) x.tmp[i] = ptr[sizeof(T) - i - 1];
LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1];
*(T*)var.memadr = x.t;
}

View File

@ -339,11 +339,11 @@
alt_fm.stride = 19;
alt_fm.width = 38;
alt_fm.height = 49;
for (uint8_t i = 0; i < 127; i++)
LOOP_L_N(i, 127)
alt_fm.char_widths[i] = 0;
// For special characters, copy the character widths from the char tables
for (uint8_t i = 0; i < NUM_ELEMENTS(char_recipe); i++) {
LOOP_L_N(i, NUM_ELEMENTS(char_recipe)) {
uint8_t std_char, alt_char, alt_data;
get_char_data(i, std_char, alt_char, alt_data);
if (std_char == 0)

View File

@ -36,7 +36,7 @@ void MoveAxisScreen::onEntry() {
// ourselves. The relative distances are reset to zero whenever this
// screen is entered.
for (uint8_t i = 0; i < ExtUI::extruderCount; i++) {
LOOP_L_N(i, ExtUI::extruderCount) {
screen_data.MoveAxisScreen.e_rel[i] = 0;
}
BaseNumericAdjustmentScreen::onEntry();