Merge pull request #5 in FS/freeswitch from ~KATHLEEN.KING/freeswitch-fork:clang-warnings-werror to master

* commit '1affff9db4aaa29ab66f9f5db76f575eeabd86b5':
  Fixed a clang-3.5 missing-prototype warning and added doxygen documentation for switch_channel_set_presence_data_vals. #doxygen
  Fixed dead code.
  Fixed trucation of value warning.
  Removed a useless called to abs.
  Removed an autological-pointer-compare from src/switch_utils.c.
  Fixed trucation of value warning.
This commit is contained in:
Mike Jerris 2014-07-14 17:38:21 -05:00
commit 6dca24bb2a
6 changed files with 31 additions and 30 deletions

View File

@ -165,6 +165,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(_In_ switch_channel_t **cha
SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, switch_core_session_t *session, switch_channel_state_t state,
switch_channel_flag_t flag);
/*!
\brief Takes presence_data_cols as a parameter or as a channel variable and copies them to channel profile variables
\param channel the channel on which to set the channel profile variables
\param presence_data_cols is a colon separated list of channel variables to copy to channel profile variables
*/
SWITCH_DECLARE(void) switch_channel_set_presence_data_vals(switch_channel_t *channel, const char *presence_data_cols);
/*!
\brief Fire A presence event for the channel
\param channel the channel to initilize

View File

@ -622,7 +622,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
maxlen = atol(p);
if ((q = strchr(p, ':'))) {
q++;
max_drift = abs(atol(q));
max_drift = abs(atoi(q));
}
}
}

View File

@ -1336,32 +1336,30 @@ SWITCH_DECLARE(switch_status_t) switch_channel_transfer_variable_prefix(switch_c
SWITCH_DECLARE(void) switch_channel_set_presence_data_vals(switch_channel_t *channel, const char *presence_data_cols)
{
if (!zstr(presence_data_cols)) {
char *cols[128] = { 0 };
char header_name[128] = "";
int col_count = 0, i = 0;
char *data_copy = NULL;
char *cols[128] = { 0 };
char header_name[128] = "";
int col_count = 0, i = 0;
char *data_copy = NULL;
if (zstr(presence_data_cols)) {
presence_data_cols = switch_channel_get_variable_dup(channel, "presence_data_cols", SWITCH_FALSE, -1);
if (zstr(presence_data_cols)) {
presence_data_cols = switch_channel_get_variable_dup(channel, "presence_data_cols", SWITCH_FALSE, -1);
if (zstr(presence_data_cols)) {
return;
}
return;
}
data_copy = strdup(presence_data_cols);
col_count = switch_split(data_copy, ':', cols);
for (i = 0; i < col_count; i++) {
const char *val = NULL;
switch_snprintf(header_name, sizeof(header_name), "PD-%s", cols[i]);
val = switch_channel_get_variable(channel, cols[i]);
switch_channel_set_profile_var(channel, header_name, val);
}
switch_safe_free(data_copy);
}
data_copy = strdup(presence_data_cols);
col_count = switch_split(data_copy, ':', cols);
for (i = 0; i < col_count; i++) {
const char *val = NULL;
switch_snprintf(header_name, sizeof(header_name), "PD-%s", cols[i]);
val = switch_channel_get_variable(channel, cols[i]);
switch_channel_set_profile_var(channel, header_name, val);
}
switch_safe_free(data_copy);
}

View File

@ -7655,7 +7655,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
maxlen = atol(p);
if ((q = strchr(p, ':'))) {
q++;
max_drift = abs(atol(q));
max_drift = abs(atoi(q));
}
}
}

View File

@ -6341,7 +6341,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
if (!switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
this_ts = ntohl(send_msg->header.ts);
if (abs(rtp_session->last_write_ts - this_ts) > 16000) {
if ((this_ts - rtp_session->last_write_ts) > 16000) {
rtp_session->flags[SWITCH_RTP_FLAG_RESET] = 1;
}

View File

@ -1560,10 +1560,6 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
goto doh;
}
if (iface_out.sin6_addr.s6_addr == 0) {
goto doh;
}
inet_ntop(AF_INET6, (const void *) &iface_out.sin6_addr, buf, len - 1);
status = SWITCH_STATUS_SUCCESS;
}