From 4363c224f542f56fb725ef9019099780407ac157 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 28 Feb 2006 05:55:22 +0000 Subject: [PATCH] fix msvc warnings. fix high priority on windows. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@695 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_core.h | 2 +- src/include/switch_ivr.h | 2 +- src/include/switch_module_interfaces.h | 2 +- src/mod/asr_tts/mod_cepstral/mod_cepstral.c | 2 +- .../languages/mod_spidermonkey/mod_spidermonkey.c | 4 ++-- src/switch.c | 1 + src/switch_core.c | 2 +- src/switch_ivr.c | 15 ++++++++------- w32/vsnet/FreeSwitchCore.vcproj | 4 ++-- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/include/switch_core.h b/src/include/switch_core.h index f3c6f4cdf5..eec970ca3a 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -769,7 +769,7 @@ SWITCH_DECLARE(switch_status) switch_core_file_close(switch_file_handle *fh); SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh, char *module_name, char *voice_name, - int rate, + unsigned int rate, switch_speech_flag flags, switch_memory_pool *pool); diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index c8409dd836..b67c388573 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -125,7 +125,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session char *tts_name, char *voice_name, char *timer_name, - size_t rate, + unsigned int rate, switch_dtmf_callback_function dtmf_callback, char *text, void *buf, diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index 39712cd0bd..1bad60b166 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -291,7 +291,7 @@ struct switch_speech_interface { /*! function to open the speech interface */ switch_status (*speech_open)(switch_speech_handle *sh, char *voice_name, - int rate, + unsigned int rate, switch_speech_flag flags); /*! function to close the speech interface */ switch_status (*speech_close)(switch_speech_handle *, switch_speech_flag *flags); diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c index cee9fff7d8..278194835b 100644 --- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c +++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c @@ -75,7 +75,7 @@ static swift_result_t write_audio(swift_event *event, swift_event_t type, void * return rv; } -static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, int rate, switch_speech_flag flags) +static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, unsigned int rate, switch_speech_flag flags) { if (flags & SWITCH_SPEECH_FLAG_ASR) { return SWITCH_STATUS_FALSE; diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 6a58bda2a5..87ec46e76c 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -78,7 +78,7 @@ static JSClass global_class = { struct dtmf_callback_state { struct js_session *session_state; char code_buffer[1024]; - int code_buffer_len; + size_t code_buffer_len; char ret_buffer[1024]; int ret_buffer_len; int digit_count; @@ -198,9 +198,9 @@ static switch_status js_dtmf_callback(switch_core_session *session, char *dtmf, if (*ret == '+' || *ret == '-') { switch_codec *codec; - codec = switch_core_session_get_read_codec(jss->session); unsigned int samps = 0; unsigned int pos = 0; + codec = switch_core_session_get_read_codec(jss->session); if (*ret == '+') { ret++; samps = atoi(ret) * (codec->implementation->samples_per_second / 1000); diff --git a/src/switch.c b/src/switch.c index b20ebd02ac..77b5d98e04 100644 --- a/src/switch.c +++ b/src/switch.c @@ -77,6 +77,7 @@ int main(int argc, char *argv[]) FILE *f; #ifdef WIN32 char sep = '\\'; + SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); #else char sep = '/'; int pid; diff --git a/src/switch_core.c b/src/switch_core.c index 72e50e68ce..4d756b3a5c 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -476,7 +476,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_close(switch_directory_handl SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh, char *module_name, char *voice_name, - int rate, + unsigned int rate, switch_speech_flag flags, switch_memory_pool *pool) { diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 6569cc939a..64e0580c1f 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -364,10 +364,10 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session, if (fh->speed && do_speed) { - float factor = 0.25 * abs(fh->speed); - unsigned int newlen, supplement, step; + float factor = 0.25f * abs(fh->speed); + size_t newlen, supplement, step; short *bp = write_frame.data; - int wrote = 0; + size_t wrote = 0; if (!fh->audio_buffer) { switch_buffer_create(fh->memory_pool, &fh->audio_buffer, SWITCH_RECCOMMENDED_BUFFER_SIZE); @@ -386,7 +386,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session, } else { float f; short s; - f = *bp + *(bp+1) + *(bp-1); + f = (float)(*bp + *(bp+1) + *(bp-1)); f /= 3; s = (short) f; switch_buffer_write(fh->audio_buffer, &s, 2); @@ -394,7 +394,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session, } } if (wrote < newlen) { - unsigned int r = newlen - wrote; + size_t r = newlen - wrote; switch_buffer_write(fh->audio_buffer, bp, r*2); wrote += r; } @@ -452,7 +452,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session char *tts_name, char *voice_name, char *timer_name, - size_t rate, + unsigned int rate, switch_dtmf_callback_function dtmf_callback, char *text, void *buf, @@ -461,7 +461,8 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session switch_channel *channel; short abuf[960]; char dtmf[128]; - int interval = 0, samples = 0; + int interval = 0; + unsigned int samples = 0; size_t len = 0; size_t ilen = 0; switch_frame write_frame; diff --git a/w32/vsnet/FreeSwitchCore.vcproj b/w32/vsnet/FreeSwitchCore.vcproj index 99f9533a23..cc13df7833 100644 --- a/w32/vsnet/FreeSwitchCore.vcproj +++ b/w32/vsnet/FreeSwitchCore.vcproj @@ -100,7 +100,7 @@ />