FS-7966: fix more msvc 2015 warnings.

This commit is contained in:
Mike Jerris
2015-08-31 17:08:52 -04:00
parent 4b8587a863
commit 5c59a0159d
30 changed files with 79 additions and 66 deletions
+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;