mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Build with -Wfloat-conversion + fix all warnings
This commit is contained in:

committed by
GitHub

parent
17c459e384
commit
a919774fe4
@@ -966,8 +966,8 @@ static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec
|
||||
const int thisw = thisspec->width;
|
||||
const int thish = thisspec->height;
|
||||
const float thisaspect = ((float)thisw) / ((float)thish);
|
||||
const float aspectdiff = SDL_fabs(wantaspect - thisaspect);
|
||||
const float diff = SDL_fabs(closestaspect - thisaspect);
|
||||
const float aspectdiff = SDL_fabsf(wantaspect - thisaspect);
|
||||
const float diff = SDL_fabsf(closestaspect - thisaspect);
|
||||
const int diffw = SDL_abs(thisw - wantw);
|
||||
if (diff < epsilon) { // matches current closestaspect? See if resolution is closer in size.
|
||||
if (diffw < closestdiffw) {
|
||||
@@ -1022,7 +1022,7 @@ static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec
|
||||
}
|
||||
|
||||
const float thisfps = thisspec->interval_denominator ? (thisspec->interval_numerator / thisspec->interval_denominator) : 0.0f;
|
||||
const float fpsdiff = SDL_fabs(wantfps - thisfps);
|
||||
const float fpsdiff = SDL_fabsf(wantfps - thisfps);
|
||||
if (fpsdiff < closestfps) { // this is a closest FPS? Take it until something closer arrives.
|
||||
closestfps = fpsdiff;
|
||||
closest->interval_numerator = thisspec->interval_numerator;
|
||||
|
Reference in New Issue
Block a user