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:
Corey Farrell
2017-12-18 16:36:21 -05:00
parent 11a1e07ad2
commit b3e839debd
5 changed files with 19 additions and 52 deletions

View File

@@ -309,8 +309,10 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
BerElement *ber = NULL;
struct ast_variable *var = NULL;
struct ast_variable *prev = NULL;
#if 0
int is_delimited = 0;
int i = 0;
#endif
char *ldap_attribute_name;
struct berval *value;
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);
}
if (valptr) {
#if 0
/* ok, so looping through all delimited values except the last one (not, last character is not delimited...) */
if (is_delimited) {
i = 0;
@@ -358,6 +361,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config
i++;
}
}
#endif
/* for the last delimited value or if the value is not delimited: */
if (prev) {
prev->next = ast_variable_new(attribute_name, &valptr[pos], table_config->table_name);