Fix -Wdeclaration-after-statement warnings

This commit is contained in:
Anonymous Maarten
2024-08-12 20:02:43 +02:00
committed by Anonymous Maarten
parent 354a35c1d7
commit 248cb3ca9c
14 changed files with 112 additions and 57 deletions

View File

@@ -61,6 +61,7 @@ SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percen
#else /* TARGET_OS_TV */
@autoreleasepool {
UIDevice *uidev = [UIDevice currentDevice];
const float level = uidev.batteryLevel;
if (!SDL_UIKitLastPowerInfoQuery) {
SDL_assert(uidev.isBatteryMonitoringEnabled == NO);
@@ -95,7 +96,6 @@ SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percen
break;
}
const float level = uidev.batteryLevel;
*percent = ((level < 0.0f) ? -1 : ((int)((level * 100) + 0.5f)));
}
#endif /* TARGET_OS_TV */