Remove constant conditionals (dead-code).
Some variables are set and never changed, making them constant. This means that code in the 'false' block of the conditional is unreachable. In chan_skinny and res_config_ldap I used preprocessor directive `#if 0` as I'm unsure if the unreachable code could be enabled in the future. Change-Id: I62e2aac353d739fb3c983cf768933120f5fba059
This commit is contained in:
parent
11a1e07ad2
commit
b3e839debd
|
@ -4753,15 +4753,19 @@ static void start_rtp(struct skinny_subchannel *sub)
|
||||||
{
|
{
|
||||||
struct skinny_line *l = sub->line;
|
struct skinny_line *l = sub->line;
|
||||||
struct skinny_device *d = l->device;
|
struct skinny_device *d = l->device;
|
||||||
|
#if 0
|
||||||
int hasvideo = 0;
|
int hasvideo = 0;
|
||||||
|
#endif
|
||||||
struct ast_sockaddr bindaddr_tmp;
|
struct ast_sockaddr bindaddr_tmp;
|
||||||
|
|
||||||
skinny_locksub(sub);
|
skinny_locksub(sub);
|
||||||
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %u - Starting RTP\n", sub->callid);
|
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %u - Starting RTP\n", sub->callid);
|
||||||
ast_sockaddr_from_sin(&bindaddr_tmp, &bindaddr);
|
ast_sockaddr_from_sin(&bindaddr_tmp, &bindaddr);
|
||||||
sub->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr_tmp, NULL);
|
sub->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr_tmp, NULL);
|
||||||
|
#if 0
|
||||||
if (hasvideo)
|
if (hasvideo)
|
||||||
sub->vrtp = ast_rtp_instance_new("asterisk", sched, &bindaddr_tmp, NULL);
|
sub->vrtp = ast_rtp_instance_new("asterisk", sched, &bindaddr_tmp, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sub->rtp) {
|
if (sub->rtp) {
|
||||||
ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
|
@ -4775,11 +4779,13 @@ static void start_rtp(struct skinny_subchannel *sub)
|
||||||
ast_channel_set_fd(sub->owner, 0, ast_rtp_instance_fd(sub->rtp, 0));
|
ast_channel_set_fd(sub->owner, 0, ast_rtp_instance_fd(sub->rtp, 0));
|
||||||
ast_channel_set_fd(sub->owner, 1, ast_rtp_instance_fd(sub->rtp, 1));
|
ast_channel_set_fd(sub->owner, 1, ast_rtp_instance_fd(sub->rtp, 1));
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
if (hasvideo && sub->vrtp && sub->owner) {
|
if (hasvideo && sub->vrtp && sub->owner) {
|
||||||
ast_rtp_instance_set_channel_id(sub->vrtp, ast_channel_uniqueid(sub->owner));
|
ast_rtp_instance_set_channel_id(sub->vrtp, ast_channel_uniqueid(sub->owner));
|
||||||
ast_channel_set_fd(sub->owner, 2, ast_rtp_instance_fd(sub->vrtp, 0));
|
ast_channel_set_fd(sub->owner, 2, ast_rtp_instance_fd(sub->vrtp, 0));
|
||||||
ast_channel_set_fd(sub->owner, 3, ast_rtp_instance_fd(sub->vrtp, 1));
|
ast_channel_set_fd(sub->owner, 3, ast_rtp_instance_fd(sub->vrtp, 1));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (sub->rtp) {
|
if (sub->rtp) {
|
||||||
ast_rtp_instance_set_qos(sub->rtp, qos.tos_audio, qos.cos_audio, "Skinny RTP");
|
ast_rtp_instance_set_qos(sub->rtp, qos.tos_audio, qos.cos_audio, "Skinny RTP");
|
||||||
ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_NAT, l->nat);
|
ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_NAT, l->nat);
|
||||||
|
|
|
@ -42,7 +42,6 @@ static void manager_system_shutdown(void)
|
||||||
|
|
||||||
int manager_system_init(void)
|
int manager_system_init(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
struct stasis_topic *manager_topic;
|
struct stasis_topic *manager_topic;
|
||||||
struct stasis_topic *system_topic;
|
struct stasis_topic *system_topic;
|
||||||
struct stasis_message_router *message_router;
|
struct stasis_message_router *message_router;
|
||||||
|
@ -67,13 +66,5 @@ int manager_system_init(void)
|
||||||
|
|
||||||
ast_register_cleanup(manager_system_shutdown);
|
ast_register_cleanup(manager_system_shutdown);
|
||||||
|
|
||||||
/* If somehow we failed to add any routes, just shut down the whole
|
|
||||||
* thing and fail it.
|
|
||||||
*/
|
|
||||||
if (ret) {
|
|
||||||
manager_system_shutdown();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1506,16 +1506,14 @@ static int tzparse(const char *name, struct state *sp, const int lastditch)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
long theirstdoffset;
|
long theirstdoffset;
|
||||||
long theirdstoffset;
|
|
||||||
long theiroffset;
|
long theiroffset;
|
||||||
int isdst;
|
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
if (*name != '\0')
|
if (*name != '\0')
|
||||||
return -1;
|
return -1;
|
||||||
/*
|
/*
|
||||||
** Initial values of theirstdoffset and theirdstoffset.
|
** Initial values of theirstdoffset.
|
||||||
*/
|
*/
|
||||||
theirstdoffset = 0;
|
theirstdoffset = 0;
|
||||||
for (i = 0; i < sp->timecnt; ++i) {
|
for (i = 0; i < sp->timecnt; ++i) {
|
||||||
|
@ -1526,19 +1524,6 @@ static int tzparse(const char *name, struct state *sp, const int lastditch)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
theirdstoffset = 0;
|
|
||||||
for (i = 0; i < sp->timecnt; ++i) {
|
|
||||||
j = sp->types[i];
|
|
||||||
if (sp->ttis[j].tt_isdst) {
|
|
||||||
theirdstoffset =
|
|
||||||
-sp->ttis[j].tt_gmtoff;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
** Initially we're assumed to be in standard time.
|
|
||||||
*/
|
|
||||||
isdst = FALSE;
|
|
||||||
theiroffset = theirstdoffset;
|
theiroffset = theirstdoffset;
|
||||||
/*
|
/*
|
||||||
** Now juggle transition times and types
|
** Now juggle transition times and types
|
||||||
|
@ -1550,32 +1535,13 @@ static int tzparse(const char *name, struct state *sp, const int lastditch)
|
||||||
if (sp->ttis[j].tt_ttisgmt) {
|
if (sp->ttis[j].tt_ttisgmt) {
|
||||||
/* No adjustment to transition time */
|
/* No adjustment to transition time */
|
||||||
} else {
|
} else {
|
||||||
/*
|
/* Add the standard time offset to the transition time. */
|
||||||
** If summer time is in effect, and the
|
sp->ats[i] += stdoffset - theirstdoffset;
|
||||||
** transition time was not specified as
|
|
||||||
** standard time, add the summer time
|
|
||||||
** offset to the transition time;
|
|
||||||
** otherwise, add the standard time
|
|
||||||
** offset to the transition time.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
** Transitions from DST to DDST
|
|
||||||
** will effectively disappear since
|
|
||||||
** POSIX provides for only one DST
|
|
||||||
** offset.
|
|
||||||
*/
|
|
||||||
if (isdst && !sp->ttis[j].tt_ttisstd) {
|
|
||||||
sp->ats[i] += dstoffset -
|
|
||||||
theirdstoffset;
|
|
||||||
} else {
|
|
||||||
sp->ats[i] += stdoffset -
|
|
||||||
theirstdoffset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
theiroffset = -sp->ttis[j].tt_gmtoff;
|
theiroffset = -sp->ttis[j].tt_gmtoff;
|
||||||
if (sp->ttis[j].tt_isdst)
|
if (!sp->ttis[j].tt_isdst) {
|
||||||
theirdstoffset = theiroffset;
|
theirstdoffset = theiroffset;
|
||||||
else theirstdoffset = theiroffset;
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
** Finally, fill in ttis.
|
** Finally, fill in ttis.
|
||||||
|
|
|
@ -1411,7 +1411,7 @@ static int xmldoc_parse_example(struct ast_xml_node *fixnode, struct ast_str **b
|
||||||
static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *tabs, const char *posttabs, struct ast_str **buffer)
|
static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *tabs, const char *posttabs, struct ast_str **buffer)
|
||||||
{
|
{
|
||||||
struct ast_xml_node *node = fixnode;
|
struct ast_xml_node *node = fixnode;
|
||||||
int ret = 0, i, count = 0;
|
int ret = 0, i;
|
||||||
|
|
||||||
if (!node || !ast_xml_node_get_children(node)) {
|
if (!node || !ast_xml_node_get_children(node)) {
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1438,8 +1438,8 @@ static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *ta
|
||||||
/* parse <para> elements inside special tags. */
|
/* parse <para> elements inside special tags. */
|
||||||
for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) {
|
for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) {
|
||||||
/* first <para> just print it without tabs at the begining. */
|
/* first <para> just print it without tabs at the begining. */
|
||||||
if ((xmldoc_parse_para(node, (!count ? "" : tabs), posttabs, buffer) == 2)
|
if ((xmldoc_parse_para(node, "", posttabs, buffer) == 2)
|
||||||
|| (xmldoc_parse_info(node, (!count ? "": tabs), posttabs, buffer) == 2)) {
|
|| (xmldoc_parse_info(node, "", posttabs, buffer) == 2)) {
|
||||||
ret = 2;
|
ret = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,8 +309,10 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
|
||||||
BerElement *ber = NULL;
|
BerElement *ber = NULL;
|
||||||
struct ast_variable *var = NULL;
|
struct ast_variable *var = NULL;
|
||||||
struct ast_variable *prev = NULL;
|
struct ast_variable *prev = NULL;
|
||||||
|
#if 0
|
||||||
int is_delimited = 0;
|
int is_delimited = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
#endif
|
||||||
char *ldap_attribute_name;
|
char *ldap_attribute_name;
|
||||||
struct berval *value;
|
struct berval *value;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
@ -338,6 +340,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
|
||||||
ast_debug(2, "md5: %s\n", valptr);
|
ast_debug(2, "md5: %s\n", valptr);
|
||||||
}
|
}
|
||||||
if (valptr) {
|
if (valptr) {
|
||||||
|
#if 0
|
||||||
/* ok, so looping through all delimited values except the last one (not, last character is not delimited...) */
|
/* ok, so looping through all delimited values except the last one (not, last character is not delimited...) */
|
||||||
if (is_delimited) {
|
if (is_delimited) {
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -358,6 +361,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* for the last delimited value or if the value is not delimited: */
|
/* for the last delimited value or if the value is not delimited: */
|
||||||
if (prev) {
|
if (prev) {
|
||||||
prev->next = ast_variable_new(attribute_name, &valptr[pos], table_config->table_name);
|
prev->next = ast_variable_new(attribute_name, &valptr[pos], table_config->table_name);
|
||||||
|
|
Loading…
Reference in New Issue