From 6b5b1a3d869e33674f9cc9fb86fa157d04ef05ad Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 26 Oct 2015 13:45:48 -0400 Subject: [PATCH] FS-8389: [build] Fix msvc 2015 build warnings --- src/include/switch_utils.h | 4 ++-- .../mod_conference/conference_video.c | 2 +- src/mod/codecs/mod_opus/mod_opus.c | 13 +++++++------ .../mod_skypopen/mod_skypopen.2015.vcxproj | 18 ++++++++++++------ src/mod/endpoints/mod_sofia/sofia.c | 2 +- .../mod_local_stream/mod_local_stream.c | 6 +++--- 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 6f6ee6bef6..3ff7c286c4 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -859,7 +859,7 @@ static inline switch_bool_t switch_strstr(char *s, char *q) S = strdup(s); - assert(S != NULL); + switch_assert(S != NULL); for (p = S; p && *p; p++) { *p = (char) switch_toupper(*p); @@ -871,7 +871,7 @@ static inline switch_bool_t switch_strstr(char *s, char *q) } Q = strdup(q); - assert(Q != NULL); + switch_assert(Q != NULL); for (p = Q; p && *p; p++) { *p = (char) switch_toupper(*p); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index d45bc853b4..a229cfc8c3 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1483,7 +1483,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_ switch_time_t now = switch_time_now(); if (last) { - int delta = now - last; + int delta = (int)(now - last); if (delta > member->conference->video_fps.ms * 5000) { switch_core_session_request_video_refresh(member->session); } diff --git a/src/mod/codecs/mod_opus/mod_opus.c b/src/mod/codecs/mod_opus/mod_opus.c index 305986eebf..b327889072 100644 --- a/src/mod/codecs/mod_opus/mod_opus.c +++ b/src/mod/codecs/mod_opus/mod_opus.c @@ -858,8 +858,9 @@ static switch_status_t switch_opus_encode_repacketize(switch_codec_t *codec, int16_t *dec_ptr_buf = decoded_data; /* work inside the available buffer to avoid other buffer allocations. *encoded_data_len will be SWITCH_RECOMMENDED_BUFFER_SIZE */ unsigned char *enc_ptr_buf = (unsigned char *)encoded_data + (len / 2); - int nb_frames = codec->implementation->microseconds_per_packet / 20000 ; /* requested ptime: 20 ms * nb_frames */ - int frame_size, i, bytes = 0, want_fec = 0, toggle_fec = 0; + uint32_t nb_frames = codec->implementation->microseconds_per_packet / 20000 ; /* requested ptime: 20 ms * nb_frames */ + uint32_t frame_size, i; + int bytes = 0, want_fec = 0, toggle_fec = 0; opus_int32 ret = 0; opus_int32 total_len = 0; switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -879,7 +880,7 @@ static switch_status_t switch_opus_encode_repacketize(switch_codec_t *codec, } frame_size = (decoded_data_len / 2) / nb_frames; if((frame_size * nb_frames) != context->enc_frame_size) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,"Encoder Error: Decoded Datalen %u Number of frames: %d Encoder frame size: %d\n",decoded_data_len,nb_frames,context->enc_frame_size); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,"Encoder Error: Decoded Datalen %u Number of frames: %u Encoder frame size: %u\n",decoded_data_len,nb_frames,context->enc_frame_size); switch_goto_status(SWITCH_STATUS_GENERR, end); } opus_repacketizer_init(rp); @@ -1080,13 +1081,13 @@ static switch_status_t switch_opus_control(switch_codec_t *codec, switch(cmd) { case SCC_CODEC_SPECIFIC: { - const char *cmd = (const char *)cmd_data; + const char *command = (const char *)cmd_data; const char *arg = (const char *)cmd_arg; switch_codec_control_type_t reply_type = SCCT_STRING; const char *reply = "ERROR INVALID COMMAND"; - if (!zstr(cmd)) { - if (!strcasecmp(cmd, "jb_lookahead")) { + if (!zstr(command)) { + if (!strcasecmp(command, "jb_lookahead")) { if (!zstr(arg)) { context->use_jb_lookahead = switch_true(arg); } diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen.2015.vcxproj b/src/mod/endpoints/mod_skypopen/mod_skypopen.2015.vcxproj index bbadaa5a50..0a585149b3 100644 --- a/src/mod/endpoints/mod_skypopen/mod_skypopen.2015.vcxproj +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.2015.vcxproj @@ -130,9 +130,12 @@ - /analyze:stacksize65535 - /analyze:stacksize65535 - /analyze:stacksize65535 + + + + + + @@ -141,9 +144,12 @@ 4305;4306;28193;4244;4267;4324;6340;6246;6011;6387;%(DisableSpecificWarnings) 4305;4306;28193;4244;4267;4324;6340;6246;6011;6387;%(DisableSpecificWarnings) 4305;4306;28193;4244;4267;4324;6340;6246;6011;6387;%(DisableSpecificWarnings) - /analyze:stacksize32768 - /analyze:stacksize32768 - /analyze:stacksize32768 + + + + + + diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 2a06e882ef..c4116b0a18 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5850,7 +5850,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu int ping_time = 0; if (sofia_private && sofia_private->ping_sent) { - ping_time = switch_time_now() - sofia_private->ping_sent; + ping_time = (int)(switch_time_now() - sofia_private->ping_sent); } sip_user_status.status = ping_status; diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index 0ff2b7cec3..68fc8eb8ed 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -493,7 +493,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void break; } - source->prebuf = source->samples * 2 * source->channels; + source->prebuf = (uint32_t)(source->samples * 2 * source->channels); if (!source->total) { flush_video_queue(source->video_q); @@ -806,8 +806,8 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle local_stream_context_t *context = handle->private_info; switch_status_t status; switch_time_t now; - int fps = (int)ceil(handle->mm.fps); - int min_qsize = fps; + unsigned int fps = (unsigned int)ceil(handle->mm.fps); + unsigned int min_qsize = fps; if (!(context->ready && context->source->ready)) { return SWITCH_STATUS_FALSE;