mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 06:28:24 +02:00
Fix -Wdeclaration-after-statement warnings
This commit is contained in:
committed by
Anonymous Maarten
parent
354a35c1d7
commit
248cb3ca9c
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user