diff --git a/src/drivers/fluid_dsound.c b/src/drivers/fluid_dsound.c index 7e468aa7..a15f9813 100644 --- a/src/drivers/fluid_dsound.c +++ b/src/drivers/fluid_dsound.c @@ -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, diff --git a/src/drivers/fluid_waveout.c b/src/drivers/fluid_waveout.c index 2686e3d2..0640dff6 100644 --- a/src/drivers/fluid_waveout.c +++ b/src/drivers/fluid_waveout.c @@ -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, diff --git a/src/drivers/fluid_winmidi.c b/src/drivers/fluid_winmidi.c index 17a01d9c..48ec7a24 100644 --- a/src/drivers/fluid_winmidi.c +++ b/src/drivers/fluid_winmidi.c @@ -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; diff --git a/src/sfloader/fluid_sfont.c b/src/sfloader/fluid_sfont.c index f5de0a5b..8b4d4f17 100644 --- a/src/sfloader/fluid_sfont.c +++ b/src/sfloader/fluid_sfont.c @@ -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. *