[Horus] Warnings fixed

This commit is contained in:
Bertrand Songis
2016-02-10 14:55:00 +01:00
parent cd821116c5
commit 27fe5c198f
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -166,7 +166,7 @@ bool menuSetupScreensView(evt_t event)
currentScreen = customScreens[0];
unsigned int layoutIndex = 0;
int layoutIndex = 0;
for (unsigned int i=0; i<countRegisteredLayouts; i++) {
if (registeredLayouts[i] == currentScreen->getFactory()) {
layoutIndex = i;
@@ -182,7 +182,7 @@ bool menuSetupScreensView(evt_t event)
linesCount++;
}
SUBMENU_WITH_OPTIONS("Main views setup", LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1), ORPHAN_ROW, 0, 0, 0, 0 });
SUBMENU_WITH_OPTIONS("Main views setup", LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
for (int i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_CONTENT_TOP + i * FH;
@@ -216,8 +216,8 @@ bool menuSetupScreensView(evt_t event)
}
}
}
int lastDisplayedLayout = min<int>(menuHorizontalOffset + 4, countRegisteredLayouts);
for (int i=menuHorizontalOffset, x=SCREENS_SETUP_2ND_COLUMN; i<lastDisplayedLayout; i++, x += 56) {
unsigned int lastDisplayedLayout = min<int>(menuHorizontalOffset + 4, countRegisteredLayouts);
for (uint8_t i=menuHorizontalOffset, x=SCREENS_SETUP_2ND_COLUMN; i<lastDisplayedLayout; i++, x += 56) {
const LayoutFactory * factory = registeredLayouts[i];
factory->drawThumb(x, y, currentScreen->getFactory() == factory ? (menuHorizontalPosition < 0 ? TEXT_INVERTED_COLOR : TEXT_INVERTED_BGCOLOR) : LINE_COLOR);
}
+3 -3
View File
@@ -56,12 +56,12 @@ void GaugeWidget::refresh()
int32_t max = persistentData->options[2].signedValue;
uint16_t color = persistentData->options[3].unsignedValue;
getvalue_t value = getValue(index);
getvalue_t value_in_range = value;
int32_t value = getValue(index);
int32_t value_in_range = value;
if (value < min)
value_in_range = min;
else if (value > max)
value_in_range;
value_in_range = max;
int w = divRoundClosest(zone.w * (value_in_range - min), (max - min));
int percent = divRoundClosest(100 * (value_in_range - min), (max - min));