Build with -Wfloat-conversion + fix all warnings
This commit is contained in:
committed by
GitHub
parent
17c459e384
commit
a919774fe4
@@ -919,7 +919,7 @@ static int convert_audio_chunks(SDL_AudioStream* stream, const void* src, int sr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (to_get)
|
||||
{
|
||||
ret = get_audio_data_split(stream, (Uint8*)(dst) + total_out, to_get);
|
||||
@@ -1026,7 +1026,7 @@ static int audio_resampleLoss(void *arg)
|
||||
}
|
||||
|
||||
tick_beg = SDL_GetPerformanceCounter();
|
||||
|
||||
|
||||
buf_out = (float *)SDL_malloc(len_target);
|
||||
SDLTest_AssertCheck(buf_out != NULL, "Expected output buffer to be created.");
|
||||
if (buf_out == NULL) {
|
||||
@@ -1059,11 +1059,11 @@ static int audio_resampleLoss(void *arg)
|
||||
}
|
||||
SDL_free(buf_out);
|
||||
signal_to_noise = 10 * SDL_log10(sum_squared_value / sum_squared_error); /* decibel */
|
||||
SDLTest_AssertCheck(isfinite(sum_squared_value), "Sum of squared target should be finite.");
|
||||
SDLTest_AssertCheck(isfinite(sum_squared_error), "Sum of squared error should be finite.");
|
||||
SDLTest_AssertCheck(ISFINITE(sum_squared_value), "Sum of squared target should be finite.");
|
||||
SDLTest_AssertCheck(ISFINITE(sum_squared_error), "Sum of squared error should be finite.");
|
||||
/* Infinity is theoretically possible when there is very little to no noise */
|
||||
SDLTest_AssertCheck(!isnan(signal_to_noise), "Signal-to-noise ratio should not be NaN.");
|
||||
SDLTest_AssertCheck(isfinite(max_error), "Maximum conversion error should be finite.");
|
||||
SDLTest_AssertCheck(!ISNAN(signal_to_noise), "Signal-to-noise ratio should not be NaN.");
|
||||
SDLTest_AssertCheck(ISFINITE(max_error), "Maximum conversion error should be finite.");
|
||||
SDLTest_AssertCheck(signal_to_noise >= spec->signal_to_noise, "Conversion signal-to-noise ratio %f dB should be no less than %f dB.",
|
||||
signal_to_noise, spec->signal_to_noise);
|
||||
SDLTest_AssertCheck(max_error <= spec->max_error, "Maximum conversion error %f should be no more than %f.",
|
||||
@@ -1345,11 +1345,11 @@ static int audio_formatChange(void *arg)
|
||||
}
|
||||
|
||||
signal_to_noise = 10 * SDL_log10(sum_squared_value / sum_squared_error); /* decibel */
|
||||
SDLTest_AssertCheck(isfinite(sum_squared_value), "Sum of squared target should be finite.");
|
||||
SDLTest_AssertCheck(isfinite(sum_squared_error), "Sum of squared error should be finite.");
|
||||
SDLTest_AssertCheck(ISFINITE(sum_squared_value), "Sum of squared target should be finite.");
|
||||
SDLTest_AssertCheck(ISFINITE(sum_squared_error), "Sum of squared error should be finite.");
|
||||
/* Infinity is theoretically possible when there is very little to no noise */
|
||||
SDLTest_AssertCheck(!isnan(signal_to_noise), "Signal-to-noise ratio should not be NaN.");
|
||||
SDLTest_AssertCheck(isfinite(max_error), "Maximum conversion error should be finite.");
|
||||
SDLTest_AssertCheck(!ISNAN(signal_to_noise), "Signal-to-noise ratio should not be NaN.");
|
||||
SDLTest_AssertCheck(ISFINITE(max_error), "Maximum conversion error should be finite.");
|
||||
SDLTest_AssertCheck(signal_to_noise >= target_signal_to_noise, "Conversion signal-to-noise ratio %f dB should be no less than %f dB.",
|
||||
signal_to_noise, target_signal_to_noise);
|
||||
SDLTest_AssertCheck(max_error <= target_max_error, "Maximum conversion error %f should be no more than %f.",
|
||||
|
||||
Reference in New Issue
Block a user