From 20e09bb76df9c9c72a329726afc4e258f6ab55e7 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 30 May 2021 22:04:23 +0100 Subject: [PATCH] fix some type conversion warnings in MSVC (#903) --- doc/examples/example.c | 2 ++ doc/examples/fluidsynth_arpeggio.c | 5 +++-- doc/examples/fluidsynth_fx.c | 2 +- doc/examples/fluidsynth_metronome.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/examples/example.c b/doc/examples/example.c index eb569dc5..69d8b838 100644 --- a/doc/examples/example.c +++ b/doc/examples/example.c @@ -19,6 +19,8 @@ #if defined(WIN32) #include #define sleep(_t) Sleep(_t * 1000) +#include +#define getpid _getpid #else #include #include diff --git a/doc/examples/fluidsynth_arpeggio.c b/doc/examples/fluidsynth_arpeggio.c index 9cfa713b..91075cc4 100644 --- a/doc/examples/fluidsynth_arpeggio.c +++ b/doc/examples/fluidsynth_arpeggio.c @@ -71,7 +71,8 @@ schedule_timer_event(void) void schedule_pattern(void) { - int i, note_time, note_duration; + unsigned int i; + int note_time, note_duration; note_time = time_marker; note_duration = duration / pattern_size; @@ -135,7 +136,7 @@ main(int argc, char *argv[]) { n = atoi(argv[2]); - if((n > 1) && (n <= pattern_size)) + if((n > 1) && (n <= (int)pattern_size)) { pattern_size = n; } diff --git a/doc/examples/fluidsynth_fx.c b/doc/examples/fluidsynth_fx.c index 5ce102cf..91242260 100644 --- a/doc/examples/fluidsynth_fx.c +++ b/doc/examples/fluidsynth_fx.c @@ -141,7 +141,7 @@ int main(int argc, char **argv) /* Fill in the data of the effects unit */ fx_data.synth = synth; - fx_data.gain = atof(argv[2]); + fx_data.gain = (float)atof(argv[2]); /* Create the audio driver. As soon as the audio driver is * created, the synthesizer can be played. */ diff --git a/doc/examples/fluidsynth_metronome.c b/doc/examples/fluidsynth_metronome.c index e2898d39..68f2cceb 100644 --- a/doc/examples/fluidsynth_metronome.c +++ b/doc/examples/fluidsynth_metronome.c @@ -61,7 +61,8 @@ schedule_timer_event(void) void schedule_pattern(void) { - int i, note_time; + unsigned int i; + int note_time; note_time = time_marker; for(i = 0; i < pattern_size; ++i)