FS-7966: fix more msvc 2015 warnings.

This commit is contained in:
Mike Jerris committed 2015-08-31 17:08:52 -04:00
1 parent 4b8587a863
commit 5c59a0159d
30 files changed
+79 -66

No files matched your search

@@ -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) {
@@ -126,7 +126,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalOptions>/wd4290 /wd4996 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4838;4267;4101;4244;4554;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
@@ -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);
}
}
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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));
@@ -78,7 +78,7 @@
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -95,7 +95,7 @@
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -110,7 +110,7 @@
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -127,7 +127,7 @@
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)\src\include;%(AdditionalIncludeDirectories);..\..\..\..\libs\openssl-$(OpenSSLVersion)\include;$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
+6 -5
View File
@@ -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);