Build with -Wfloat-conversion + fix all warnings

This commit is contained in:
Anonymous Maarten
2024-06-03 23:33:29 +02:00
committed by GitHub
parent 17c459e384
commit a919774fe4
38 changed files with 199 additions and 203 deletions

View File

@@ -43,13 +43,14 @@ SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *p
return SDL_TRUE;
}
if (batteryState.charging)
if (batteryState.charging) {
*state = batteryState.chargingTime == 0.0 ? SDL_POWERSTATE_CHARGED : SDL_POWERSTATE_CHARGING;
else
} else {
*state = SDL_POWERSTATE_ON_BATTERY;
}
*seconds = batteryState.dischargingTime;
*percent = batteryState.level * 100;
*seconds = (int)batteryState.dischargingTime;
*percent = (int)batteryState.level * 100;
return SDL_TRUE;
}