Fix MinGW warnings (#861)

This commit is contained in:
Tom M 2021-04-27 20:27:56 +02:00 committed by GitHub
parent c8c3966586
commit f69a47081a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View file

@ -53,7 +53,7 @@ static char *fluid_win32_error(HRESULT hr);
/* Maximum number of stereo outputs */
#define DSOUND_MAX_STEREO_CHANNELS 4
/* Speakers mapping */
const static DWORD channel_mask_speakers[DSOUND_MAX_STEREO_CHANNELS] =
static const DWORD channel_mask_speakers[DSOUND_MAX_STEREO_CHANNELS] =
{
/* 1 stereo output */
SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,

View file

@ -52,7 +52,7 @@ static int fluid_waveout_write_processed_channels(fluid_synth_t *data, int len,
int channels_incr[]);
/* Speakers mapping */
const static DWORD channel_mask_speakers[WAVEOUT_MAX_STEREO_CHANNELS] =
static const DWORD channel_mask_speakers[WAVEOUT_MAX_STEREO_CHANNELS] =
{
/* 1 stereo output */
SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,

View file

@ -355,7 +355,7 @@ fluid_winmidi_parse_device_name(fluid_winmidi_driver_t *dev, char *dev_name)
FLUID_STRCPY(cpy_dev_name, dev_name); /* fluid_strtok() will overwrite */
next_idx = cpy_dev_name;
while(cur_idx = fluid_strtok(&next_idx, " ;"))
while(NULL != (cur_idx = fluid_strtok(&next_idx, " ;")))
{
/* try to convert current ascii index */
char *end_idx = cur_idx;

View file

@ -45,13 +45,19 @@ fluid_long_long_t default_ftell(void *handle)
return FLUID_FTELL((FILE *)handle);
}
#ifdef WIN32
#define PRIi64 "%I64d"
#else
#define PRIi64 "%lld"
#endif
int safe_fread(void *buf, fluid_long_long_t count, void *fd)
{
if(FLUID_FREAD(buf, (size_t)count, 1, (FILE *)fd) != 1)
{
if(feof((FILE *)fd))
{
FLUID_LOG(FLUID_ERR, "EOF while attempting to read %lld bytes", count);
FLUID_LOG(FLUID_ERR, "EOF while attempting to read " PRIi64 " bytes", count);
}
else
{
@ -68,13 +74,15 @@ int safe_fseek(void *fd, fluid_long_long_t ofs, int whence)
{
if(FLUID_FSEEK((FILE *)fd, ofs, whence) != 0)
{
FLUID_LOG(FLUID_ERR, "File seek failed with offset = %lld and whence = %d", ofs, whence);
FLUID_LOG(FLUID_ERR, "File seek failed with offset = " PRIi64 " and whence = %d", ofs, whence);
return FLUID_FAILED;
}
return FLUID_OK;
}
#undef PRIi64
/**
* Creates a new SoundFont loader.
*