Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #349

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/FACT_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static inline float FACT_INTERNAL_CalculateFilterFrequency(
*
* -@Woflox
*/
float freq = 2 * FAudio_sin(
float freq = 2.0f * FAudio_sinf(
F3DAUDIO_PI *
FAudio_min(desiredFrequency / sampleRate, 0.5f)
);
Expand Down Expand Up @@ -1027,21 +1027,21 @@ float FACT_INTERNAL_CalculateRPC(
}
else if (rpc->points[i].type == 1) /* Fast */
{
result += maxY * (1.0f - FAudio_pow(1.0f - FAudio_pow(deltaXNormalized, 1.0f / 1.5f), 1.5f));
result += maxY * (1.0f - FAudio_powf(1.0f - FAudio_powf(deltaXNormalized, 1.0f / 1.5f), 1.5f));
}
else if (rpc->points[i].type == 2) /* Slow */
{
result += maxY * (1.0f - FAudio_pow(1.0f - FAudio_pow(deltaXNormalized, 1.5f), 1.0f / 1.5f));
result += maxY * (1.0f - FAudio_powf(1.0f - FAudio_powf(deltaXNormalized, 1.5f), 1.0f / 1.5f));
}
else if (rpc->points[i].type == 3) /* SinCos */
{
if (maxY > 0.0f)
{
result += maxY * (1.0f - FAudio_pow(1.0f - FAudio_sqrtf(deltaXNormalized), 2.0f));
result += maxY * (1.0f - FAudio_powf(1.0f - FAudio_sqrtf(deltaXNormalized), 2.0f));
}
else
{
result += maxY * (1.0f - FAudio_sqrtf(1.0f - FAudio_pow(deltaXNormalized, 2.0f)));
result += maxY * (1.0f - FAudio_sqrtf(1.0f - FAudio_powf(deltaXNormalized, 2.0f)));
}
}
else
Expand Down Expand Up @@ -2066,8 +2066,8 @@ uint32_t FACT_INTERNAL_ParseAudioEngine(
rpcOffset,
dspPresetOffset,
dspParameterOffset;
uint16_t blob1Count, blob2Count;
uint8_t version, tool;
uint16_t blob1Count, blob2Count, tool;
uint8_t version;
uint8_t se;
uint32_t magic;
size_t memsize;
Expand Down
2 changes: 1 addition & 1 deletion src/FAudioFX_reverb.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static inline void DspBiQuad_Change(
float q,
float gain
) {
const float TWOPI = 6.283185307179586476925286766559005;
const float TWOPI = (float)6.283185307179586476925286766559005;
float theta_c = (TWOPI * frequency) / (float) filter->sampleRate;
float mu = DbGainToFactor(gain);
float beta = (type == DSP_BIQUAD_LOWSHELVING) ?
Expand Down
2 changes: 1 addition & 1 deletion src/FAudio_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static inline void FAudio_INTERNAL_FilterVoice(
filterState[ci][FAudioHighPassFilter] = samples[j * numChannels + ci] - filterState[ci][FAudioLowPassFilter] - (filter->OneOverQ * filterState[ci][FAudioBandPassFilter]);
filterState[ci][FAudioBandPassFilter] = (filter->Frequency * filterState[ci][FAudioHighPassFilter]) + filterState[ci][FAudioBandPassFilter];
filterState[ci][FAudioNotchFilter] = filterState[ci][FAudioHighPassFilter] + filterState[ci][FAudioLowPassFilter];
samples[j * numChannels + ci] = filterState[ci][filter->Type] * filter->WetDryMix + samples[j * numChannels + ci] * (1.0 - filter->WetDryMix);
samples[j * numChannels + ci] = filterState[ci][filter->Type] * filter->WetDryMix + samples[j * numChannels + ci] * (1.0f - filter->WetDryMix);
}

LOG_FUNC_EXIT(audio)
Expand Down
2 changes: 2 additions & 0 deletions src/FAudio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#define FAudio_strlcpy(ptr1, ptr2, size) lstrcpynA(ptr1, ptr2, size)

#define FAudio_pow(x, y) pow(x, y)
#define FAudio_powf(x, y) powf(x, y)
#define FAudio_log(x) log(x)
#define FAudio_log10(x) log10(x)
#define FAudio_sin(x) sin(x)
Expand Down Expand Up @@ -138,6 +139,7 @@ extern void FAudio_Log(char const *msg);
#define FAudio_strlcpy(ptr1, ptr2, size) SDL_strlcpy(ptr1, ptr2, size)

#define FAudio_pow(x, y) SDL_pow(x, y)
#define FAudio_powf(x, y) SDL_powf(x, y)
#define FAudio_log(x) SDL_log(x)
#define FAudio_log10(x) SDL_log10(x)
#define FAudio_sin(x) SDL_sin(x)
Expand Down
3 changes: 2 additions & 1 deletion src/FAudio_platform_sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ void FAudio_PlatformInit(

FAudio_assert(mixFormat != NULL);
FAudio_assert(updateSize != NULL);
FAudio_assert((mixFormat->Format.nChannels <= 255) && "mixFormat->Format.nChannels out of range!");

/* Build the device spec */
want.freq = mixFormat->Format.nSamplesPerSec;
want.format = AUDIO_F32SYS;
want.channels = mixFormat->Format.nChannels;
want.channels = (Uint8)(mixFormat->Format.nChannels);
want.silence = 0;
want.callback = FAudio_INTERNAL_MixCallback;
want.userdata = audio;
Expand Down
2 changes: 1 addition & 1 deletion src/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ static void skip(vorb *z, int n)
}
#ifndef STB_VORBIS_NO_STDIO
{
long x = ftell(z->f);
int64_t x = ftell(z->f);
fseek(z->f, x+n, SEEK_SET);
}
#endif
Expand Down
Loading