From 5c59a0159dbe9e4189fbdfb67284e6e5ffe9afe9 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 31 Aug 2015 17:08:52 -0400 Subject: [PATCH] FS-7966: fix more msvc 2015 warnings. --- .../win32/ldns/ldns-lib/ldns-lib.2015.vcxproj | 2 +- libs/win32/libcbt/libcbt.2015.vcxproj | 1 + libs/win32/opus/opus.celt.2015.vcxproj | 2 ++ libs/win32/opus/opus.silk_common.2015.vcxproj | 2 ++ libs/win32/opus/opus.silk_fixed.2015.vcxproj | 2 ++ libs/win32/opus/opus.silk_float.2015.vcxproj | 2 ++ libs/win32/portaudio/portaudio.2015.vcxproj | 16 +++++++------- .../mod_callcenter/mod_callcenter.c | 12 +++++----- .../mod_distributor/mod_distributor.c | 4 ++-- .../applications/mod_dptools/mod_dptools.c | 22 +++++++++---------- .../mod_expr/mod_expr.2015.vcxproj | 8 +++---- src/mod/applications/mod_fifo/mod_fifo.c | 2 +- src/mod/applications/mod_hash/mod_hash.c | 1 - src/mod/applications/mod_httapi/mod_httapi.c | 2 +- .../mod_nibblebill/mod_nibblebill.c | 2 +- .../mod_redis/mod_redis.2015.vcxproj | 7 +++++- .../mod_dialplan_asterisk.c | 2 +- .../endpoints/mod_dingaling/mod_dingaling.c | 1 - .../win32/gsmlib.2015.vcxproj | 2 +- src/mod/endpoints/mod_loopback/mod_loopback.c | 4 ++-- src/mod/endpoints/mod_rtmp/rtmp.c | 4 ++-- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- src/mod/endpoints/mod_sofia/sofia_presence.c | 4 ++-- src/mod/endpoints/mod_sofia/sofia_reg.c | 4 ++-- src/mod/endpoints/mod_verto/mcast/mcast.c | 2 +- .../mod_verto/mod_verto.2015.vcxproj | 8 +++---- src/mod/endpoints/mod_verto/mod_verto.c | 11 +++++----- .../mod_event_socket/mod_event_socket.c | 2 +- .../mod_local_stream/mod_local_stream.c | 10 ++++----- src/switch_core_codec.c | 2 +- 30 files changed, 79 insertions(+), 66 deletions(-) diff --git a/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj b/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj index 316b6fbb15..1db946397d 100644 --- a/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj +++ b/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj @@ -90,7 +90,7 @@ EnableFastChecks MultiThreadedDebugDLL Level3 - EditAndContinue + ProgramDatabase 4013;4101;4996;4267;4244;%(DisableSpecificWarnings) diff --git a/libs/win32/libcbt/libcbt.2015.vcxproj b/libs/win32/libcbt/libcbt.2015.vcxproj index 1f6f67d5c0..1f79443e5d 100644 --- a/libs/win32/libcbt/libcbt.2015.vcxproj +++ b/libs/win32/libcbt/libcbt.2015.vcxproj @@ -91,6 +91,7 @@ true $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include 4311;4302;4800;4101;4267;%(DisableSpecificWarnings) + ProgramDatabase Windows diff --git a/libs/win32/opus/opus.celt.2015.vcxproj b/libs/win32/opus/opus.celt.2015.vcxproj index d799646d40..624f6c1d87 100644 --- a/libs/win32/opus/opus.celt.2015.vcxproj +++ b/libs/win32/opus/opus.celt.2015.vcxproj @@ -97,6 +97,7 @@ HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories) MultiThreadedDebugDLL + ProgramDatabase Windows @@ -124,6 +125,7 @@ HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories) MultiThreadedDebugDLL + ProgramDatabase Windows diff --git a/libs/win32/opus/opus.silk_common.2015.vcxproj b/libs/win32/opus/opus.silk_common.2015.vcxproj index 102f81bc92..23c9fbc515 100644 --- a/libs/win32/opus/opus.silk_common.2015.vcxproj +++ b/libs/win32/opus/opus.silk_common.2015.vcxproj @@ -94,6 +94,7 @@ HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL + ProgramDatabase Windows @@ -121,6 +122,7 @@ HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL + ProgramDatabase Windows diff --git a/libs/win32/opus/opus.silk_fixed.2015.vcxproj b/libs/win32/opus/opus.silk_fixed.2015.vcxproj index 7a2518c428..a1f416eb44 100644 --- a/libs/win32/opus/opus.silk_fixed.2015.vcxproj +++ b/libs/win32/opus/opus.silk_fixed.2015.vcxproj @@ -93,6 +93,7 @@ ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL 4244;4133;%(DisableSpecificWarnings) + ProgramDatabase Windows @@ -109,6 +110,7 @@ ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL 4244;4133;%(DisableSpecificWarnings) + ProgramDatabase Windows diff --git a/libs/win32/opus/opus.silk_float.2015.vcxproj b/libs/win32/opus/opus.silk_float.2015.vcxproj index ead5c14889..52268b88f2 100644 --- a/libs/win32/opus/opus.silk_float.2015.vcxproj +++ b/libs/win32/opus/opus.silk_float.2015.vcxproj @@ -93,6 +93,7 @@ HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL + ProgramDatabase Windows @@ -120,6 +121,7 @@ HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions) ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include MultiThreadedDebugDLL + ProgramDatabase Windows diff --git a/libs/win32/portaudio/portaudio.2015.vcxproj b/libs/win32/portaudio/portaudio.2015.vcxproj index 22f74ecbfa..8c33f04865 100644 --- a/libs/win32/portaudio/portaudio.2015.vcxproj +++ b/libs/win32/portaudio/portaudio.2015.vcxproj @@ -140,7 +140,7 @@ true Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) @@ -167,7 +167,7 @@ true Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) @@ -193,7 +193,7 @@ MultiThreadedDebugDLL Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -219,7 +219,7 @@ MultiThreadedDebugDLL Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -245,7 +245,7 @@ MultiThreadedDebugDLL Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -271,7 +271,7 @@ MultiThreadedDebugDLL Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -298,7 +298,7 @@ true Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) @@ -325,7 +325,7 @@ true Level3 true - 4496;4312;4267;%(DisableSpecificWarnings) + 4996;4312;4267;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index c9681993b0..594908dd4d 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1598,7 +1598,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa agent_session = switch_core_session_locate(h->agent_uuid); if (agent_session) { switch_channel_t *agent_channel = switch_core_session_get_channel(agent_session); - switch_event_t *event; + switch_event_t *e; const char *cc_warning_tone = switch_channel_get_variable(agent_channel, "cc_warning_tone"); switch_channel_set_variable(agent_channel, "cc_side", "agent"); @@ -1609,11 +1609,11 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa switch_channel_set_variable(agent_channel, "cc_member_session_uuid", h->member_session_uuid); /* Playback this to the agent */ - if (cc_warning_tone && switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", "playback"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cc_warning_tone); - switch_core_session_queue_private_event(agent_session, &event, SWITCH_TRUE); + if (cc_warning_tone && switch_event_create(&e, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, "call-command", "execute"); + switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, "execute-app-name", "playback"); + switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, "execute-app-arg", cc_warning_tone); + switch_core_session_queue_private_event(agent_session, &e, SWITCH_TRUE); } status = SWITCH_STATUS_SUCCESS; diff --git a/src/mod/applications/mod_distributor/mod_distributor.c b/src/mod/applications/mod_distributor/mod_distributor.c index feef887345..7b1ae3790e 100644 --- a/src/mod/applications/mod_distributor/mod_distributor.c +++ b/src/mod/applications/mod_distributor/mod_distributor.c @@ -161,7 +161,7 @@ static int load_config(int reloading) lp = new_list; for (param = switch_xml_child(list, "node"); param; param = param->next) { - char *name = (char *) switch_xml_attr_soft(param, "name"); + char *name_attr = (char *) switch_xml_attr_soft(param, "name"); char *weight_val = (char *) switch_xml_attr_soft(param, "weight"); int tmp; @@ -171,7 +171,7 @@ static int load_config(int reloading) } switch_zmalloc(node, sizeof(*node)); - node->name = strdup(name); + node->name = strdup(name_attr); node->wval = tmp; if (np) { diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index f174f2cd04..8cc2947343 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -3840,11 +3840,11 @@ SWITCH_STANDARD_APP(pickup_function) caller_profile->callee_id_number = num; if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) { - const char *uuid = switch_channel_get_partner_uuid(channel); + const char *partner_uuid = switch_channel_get_partner_uuid(channel); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV"); - if (uuid) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid); + if (partner_uuid) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", partner_uuid); } switch_channel_event_set_data(channel, event); switch_event_fire(&event); @@ -4700,17 +4700,17 @@ static switch_status_t next_file(switch_file_handle_t *handle) if (context->file && switch_test_flag(handle, SWITCH_FILE_DATA_SHORT)) { /* TODO handle other data type flags */ switch_size_t len; uint16_t buf[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 }; - switch_status_t status; + switch_status_t stat; switch_file_handle_t fh = { 0 }; - if ((status = switch_core_file_open(&fh, context->file, handle->channels, handle->samplerate, + if ((stat = switch_core_file_open(&fh, context->file, handle->channels, handle->samplerate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL)) == SWITCH_STATUS_SUCCESS) { do { len = SWITCH_RECOMMENDED_BUFFER_SIZE / handle->channels; - if ((status = switch_core_file_read(&fh, buf, &len)) == SWITCH_STATUS_SUCCESS) { - status = switch_core_file_write(&context->fh, buf, &len); + if ((stat = switch_core_file_read(&fh, buf, &len)) == SWITCH_STATUS_SUCCESS) { + stat = switch_core_file_write(&context->fh, buf, &len); } - } while (status == SWITCH_STATUS_SUCCESS); + } while (stat == SWITCH_STATUS_SUCCESS); switch_core_file_close(&fh); switch_file_remove(context->file, handle->memory_pool); @@ -5628,10 +5628,10 @@ SWITCH_STANDARD_APP(page_function) } if ((l = switch_channel_get_variable(channel, "page_chunk_size"))) { - uint32_t tmp = switch_atoui(l); + uint32_t chunk = switch_atoui(l); - if (tmp > 0) { - chunk_size = tmp; + if (chunk > 0) { + chunk_size = chunk; } } diff --git a/src/mod/applications/mod_expr/mod_expr.2015.vcxproj b/src/mod/applications/mod_expr/mod_expr.2015.vcxproj index d2addb9aa1..462c474894 100644 --- a/src/mod/applications/mod_expr/mod_expr.2015.vcxproj +++ b/src/mod/applications/mod_expr/mod_expr.2015.vcxproj @@ -73,7 +73,7 @@ /J - 4100;4701;%(DisableSpecificWarnings) + 6031;4100;4701;%(DisableSpecificWarnings) false @@ -89,7 +89,7 @@ /J - 4100;4701;%(DisableSpecificWarnings) + 6031;4100;4701;%(DisableSpecificWarnings) false @@ -103,7 +103,7 @@ /J - 4100;4701;%(DisableSpecificWarnings) + 6031;4100;4701;%(DisableSpecificWarnings) false @@ -119,7 +119,7 @@ /J - 4100;4701;%(DisableSpecificWarnings) + 6031;4100;4701;%(DisableSpecificWarnings) false diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index d6877ef8dc..cda0386eb6 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -3677,7 +3677,7 @@ static int xml_callback(void *pArg, int argc, char **argv, char **columnNames) struct xml_helper *h = (struct xml_helper *) pArg; switch_xml_t x_out; int c_off = 0; - char exp_buf[128] = ""; + char exp_buf[128] = { 0 }; switch_time_exp_t tm; switch_time_t etime = 0; char atime[128] = ""; diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 2ab9e0ae7d..a7c2cb6aee 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -289,7 +289,6 @@ SWITCH_LIMIT_RELEASE(limit_release_hash) void *val = NULL; const void *key; switch_ssize_t keylen; - limit_hash_item_t *item = NULL; switch_core_hash_this(hi, &key, &keylen, &val); diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 844f1707dd..93a70972f8 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -2437,7 +2437,7 @@ static size_t save_file_callback(void *ptr, size_t size, size_t nmemb, void *dat } else { switch_cond_next(); } - } while (wrote != realsize && (x == -1 && (errno == EAGAIN || errno == EINTR)) && --sanity); + } while ((unsigned)wrote != realsize && (x == -1 && (errno == EAGAIN || errno == EINTR)) && --sanity); if (wrote != (int) realsize) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write! fd:%d %d out of %d [%s]\n", client->fd, wrote, realsize, strerror(errno)); diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index f6d1b51ed9..d6257ddb4a 100644 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -609,7 +609,7 @@ static switch_status_t do_billing(switch_core_session_t *session) /* we're going to make an assumption that final billing is done here. So we'll see how this goes. */ /* round total billed up as required */ - rounded_billed = ceilf(nibble_data->total * rounding_factor) / rounding_factor; + rounded_billed = ceilf((float)(nibble_data->total * rounding_factor)) / rounding_factor; if (rounded_billed < minimum_charge) { diff --git a/src/mod/applications/mod_redis/mod_redis.2015.vcxproj b/src/mod/applications/mod_redis/mod_redis.2015.vcxproj index bfb8f9739e..442bba7634 100644 --- a/src/mod/applications/mod_redis/mod_redis.2015.vcxproj +++ b/src/mod/applications/mod_redis/mod_redis.2015.vcxproj @@ -146,7 +146,12 @@ - + + 4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings) + 4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings) + 4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings) + 4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings) + diff --git a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c index 1996168663..0384e7af3e 100644 --- a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c +++ b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c @@ -166,7 +166,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt) char *pattern = NULL; char *app = NULL; char *argument = NULL; - char *expression = NULL, expression_buf[1024] = ""; + char *expression = NULL, expression_buf[1024] = { 0 }; char substituted[2048] = ""; const char *field_data = caller_profile->destination_number; int proceed = 0; diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index e92ea57c1c..9ab1c072f5 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -4018,7 +4018,6 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi char *proto = MDL_CHAT_PROTO; char *pproto = NULL, *ffrom = NULL; char *hint; - switch_event_t *event; char *from_user, *from_host; #ifdef AUTO_REPLY if (profile->auto_reply) { diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj index 34061747e3..dd468b6f13 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj +++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj @@ -126,7 +126,7 @@ true Level3 true - EditAndContinue + ProgramDatabase /wd4290 /wd4996 %(AdditionalOptions) 4838;4267;4101;4244;4554;%(DisableSpecificWarnings) diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index 7f8d7a6284..4bcd0c7d3e 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -137,12 +137,12 @@ static switch_status_t tech_init(loopback_private_t *tech_pvt, switch_core_sessi interval = codec->implementation->microseconds_per_packet / 1000; } else { const char *var; - char *modname = NULL; + char *codec_modname = NULL; if ((var = switch_channel_get_variable(channel, "loopback_initial_codec"))) { char *dup = switch_core_session_strdup(session, var); uint32_t bit, channels; - iananame = switch_parse_codec_buf(dup, &interval, &rate, &bit, &channels, &modname); + iananame = switch_parse_codec_buf(dup, &interval, &rate, &bit, &channels, &codec_modname); } } diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index 75a8b6d5c2..8c132634e7 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -1016,7 +1016,7 @@ switch_status_t rtmp_handle_data(rtmp_session_t *rsession) switch_mutex_lock(rsession->tech_pvt->readbuf_mutex); - if (rsession->tech_pvt->maxlen && switch_buffer_inuse(rsession->tech_pvt->readbuf) > rsession->tech_pvt->maxlen * 40) { + if (rsession->tech_pvt->maxlen && switch_buffer_inuse(rsession->tech_pvt->readbuf) > (switch_size_t)(rsession->tech_pvt->maxlen * 40)) { rsession->tech_pvt->over_size++; } else { rsession->tech_pvt->over_size = 0; @@ -1057,7 +1057,7 @@ switch_status_t rtmp_handle_data(rtmp_session_t *rsession) } switch_mutex_lock(rsession->tech_pvt->video_readbuf_mutex); - if (rsession->tech_pvt->video_maxlen && switch_buffer_inuse(rsession->tech_pvt->video_readbuf) > rsession->tech_pvt->video_maxlen * 100) { + if (rsession->tech_pvt->video_maxlen && switch_buffer_inuse(rsession->tech_pvt->video_readbuf) > (switch_size_t)(rsession->tech_pvt->video_maxlen * 100)) { rsession->tech_pvt->video_over_size++; } else { rsession->tech_pvt->video_over_size = 0; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 0d94ccff6e..29281d0cd6 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -94,7 +94,7 @@ static switch_status_t sofia_on_init(switch_core_session_t *session) char *dupvar = NULL; char *watch_headers[10]; unsigned int numhdrs = 0; - int i = 0; + unsigned int i = 0; dupvar = switch_core_session_strdup(session, hval); numhdrs = switch_separate_string(dupvar, ',', watch_headers, switch_arraylen(watch_headers)); if (numhdrs) { diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index d7255e8bfc..da09c30069 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2111,7 +2111,7 @@ static uint32_t check_presence_epoch(void) { struct tm tm = {0}; time_t now = switch_epoch_time_now(NULL); - uint32_t callsequence = (now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA; + uint32_t callsequence = (uint32_t)((now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA); if (!mod_sofia_globals.presence_year || callsequence >= SOFIA_PRESENCE_ROLLOVER_YEAR) { switch_mutex_lock(mod_sofia_globals.mutex); @@ -2120,7 +2120,7 @@ static uint32_t check_presence_epoch(void) if (tm.tm_year != mod_sofia_globals.presence_year) { mod_sofia_globals.presence_epoch = (uint32_t)now - (tm.tm_yday * 86400) - (tm.tm_hour * 60 * 60) - (tm.tm_min * 60) - tm.tm_sec; mod_sofia_globals.presence_year = tm.tm_year; - callsequence = ((uint32_t)now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA; + callsequence = (uint32_t)(((uint32_t)now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA); } switch_mutex_unlock(mod_sofia_globals.mutex); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index df238245b4..d6d7b87dfa 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -857,7 +857,7 @@ long sofia_reg_uniform_distribution(int max) int result; int range = max + 1; - srand((intptr_t) switch_thread_self() + switch_micro_time_now()); + srand((unsigned)((intptr_t) switch_thread_self() + switch_micro_time_now())); result = (int)((double)rand() / (((double)RAND_MAX + (double)1) / range)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Generated random %ld, max is %d\n", (long) result, max); @@ -2748,7 +2748,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, free(sql); //if (!sofia_glue_execute_sql2str(profile, profile->dbh_mutex, sql, np, nplen)) { - if (zstr(np) || (profile->max_auth_validity != 0 && cb.last_nc >= profile->max_auth_validity )) { + if (zstr(np) || (profile->max_auth_validity != 0 && (uint32_t)cb.last_nc >= profile->max_auth_validity )) { sql = switch_mprintf("delete from sip_authentication where nonce='%q'", nonce); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); ret = AUTH_STALE; diff --git a/src/mod/endpoints/mod_verto/mcast/mcast.c b/src/mod/endpoints/mod_verto/mcast/mcast.c index 1e480d0654..9da4088ccd 100644 --- a/src/mod/endpoints/mod_verto/mcast/mcast.c +++ b/src/mod/endpoints/mod_verto/mcast/mcast.c @@ -136,7 +136,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle, memcpy(&mreq.ipv6mr_multiaddr, &((struct sockaddr_in6 *)mcast_addr->ai_addr)->sin6_addr, sizeof(struct in6_addr)); mreq.ipv6mr_interface = 0; - setsockopt(handle->sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)); + setsockopt(handle->sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char *)&mreq, sizeof(mreq)); if (bind(handle->sock, (struct sockaddr *) &handle->recv_addr6, sizeof(handle->recv_addr6)) < 0) { printf("FUCK (%s) %s\n", host, strerror(errno)); diff --git a/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj b/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj index e71f52a081..55a56c62bc 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj +++ b/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj @@ -78,7 +78,7 @@ $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions) - 6031;6340;6246;6011;6387;%(DisableSpecificWarnings) + 6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings) false @@ -95,7 +95,7 @@ $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions) - 6031;6340;6246;6011;6387;%(DisableSpecificWarnings) + 6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings) false @@ -110,7 +110,7 @@ $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions) - 6031;6340;6246;6011;6387;%(DisableSpecificWarnings) + 6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings) false @@ -127,7 +127,7 @@ $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions) - 6031;6340;6246;6011;6387;%(DisableSpecificWarnings) + 6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings) false diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 3834a24ba8..3781d47285 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1100,6 +1100,8 @@ static void attach_jsock(jsock_t *jsock) switch_mutex_lock(globals.jsock_mutex); + switch_assert(jsock); + if ((jp = switch_core_hash_find(globals.jsock_hash, jsock->uuid_str))) { if (jp == jsock) { proceed = 0; @@ -1543,7 +1545,7 @@ static void http_run(jsock_t *jsock) { switch_http_request_t request = { 0 }; switch_stream_handle_t stream = { 0 }; - char *data = NULL; + char *err = NULL; char *ext; verto_vhost_t *vhost; switch_bool_t keepalive; @@ -1600,7 +1602,7 @@ new_req: memcpy(buffer, jsock->ws.buffer + request.bytes_read, bytes); } - while(bytes < request.content_length) { + while(bytes < (switch_ssize_t)request.content_length) { len = request.content_length - bytes; if ((len = ws_raw_read(&jsock->ws, buffer + bytes, len, jsock->ws.block)) < 0) { @@ -1793,9 +1795,9 @@ request_err: switch_http_free_request(&request); err: - data = "HTTP/1.1 500 Internal Server Error\r\n" + err = "HTTP/1.1 500 Internal Server Error\r\n" "Content-Length: 0\r\n\r\n"; - ws_raw_write(&jsock->ws, data, strlen(data)); + ws_raw_write(&jsock->ws, err, strlen(err)); error: return; @@ -5072,7 +5074,6 @@ static int verto_send_chat(const char *uid, const char *call_id, cJSON *msg) switch_core_session_t *session; if ((session = switch_core_session_locate(call_id))) { verto_pvt_t *tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY); - jsock_t *jsock; if ((jsock = get_jsock(tech_pvt->jsock_uuid))) { jsock_queue_event(jsock, &msg, SWITCH_FALSE); diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 3c8683ed4c..66f8e6cbb2 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -399,7 +399,7 @@ SWITCH_STANDARD_APP(socket_function) switch_sockaddr_t *sa; switch_port_t port = 8084; listener_t *listener; - int argc = 0, x = 0; + unsigned int argc = 0, x = 0; char *argv[80] = { 0 }; char *hosts[50] = { 0 }; unsigned int hosts_count = 0; 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 3b6bed2fdd..9c9eedd8dd 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -226,10 +226,10 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void const char *artist = NULL, *title = NULL; if (fd > -1) { - char *p; + char *pb; if (switch_fd_read_line(fd, path_buf, sizeof(path_buf))) { - if ((p = strchr(path_buf, '\r')) || (p = strchr(path_buf, '\n'))) { - *p = '\0'; + if ((pb = strchr(path_buf, '\r')) || (pb = strchr(path_buf, '\n'))) { + *pb = '\0'; } } else { close(fd); @@ -1011,9 +1011,9 @@ static int launch_streams(const char *name) if (zstr(name)) { for (directory = switch_xml_child(cfg, "directory"); directory; directory = directory->next) { - char *name = (char *) switch_xml_attr(directory, "name"); + char *name_attr = (char *) switch_xml_attr(directory, "name"); char *path = (char *) switch_xml_attr(directory, "path"); - launch_thread(name, path, directory); + launch_thread(name_attr, path, directory); x++; } } else if ((directory = switch_xml_find_child(cfg, "directory", "name", name))) { diff --git a/src/switch_core_codec.c b/src/switch_core_codec.c index 2c3654e897..5d51a3e62a 100644 --- a/src/switch_core_codec.c +++ b/src/switch_core_codec.c @@ -891,7 +891,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_control(switch_codec_t *codec, if (!codec->implementation || !switch_core_codec_ready(codec)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n"); abort(); - return SWITCH_STATUS_NOT_INITALIZED; + //return SWITCH_STATUS_NOT_INITALIZED; }