fix pointless warnings

This commit is contained in:
Anthony Minessale 2012-04-10 14:01:37 -05:00
parent f7b04b1045
commit c10ba04834

View File

@ -188,7 +188,7 @@ static switch_bool_t cidlookup_execute_sql_callback(char *sql, switch_core_db_ca
switch_bool_t retval = SWITCH_FALSE; switch_bool_t retval = SWITCH_FALSE;
switch_cache_db_handle_t *dbh = NULL; switch_cache_db_handle_t *dbh = NULL;
if (globals.odbc_dsn && (dbh = cidlookup_get_db_handle())) { if (!zstr(globals.odbc_dsn) && (dbh = cidlookup_get_db_handle())) {
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, (void *) cbt, err) != SWITCH_STATUS_SUCCESS) { if (switch_cache_db_execute_sql_callback(dbh, sql, callback, (void *) cbt, err) != SWITCH_STATUS_SUCCESS) {
retval = SWITCH_FALSE; retval = SWITCH_FALSE;
} else { } else {
@ -533,7 +533,7 @@ static char *do_db_lookup(switch_memory_pool_t *pool, switch_event_t *event, con
callback_t cbt = { 0 }; callback_t cbt = { 0 };
cbt.pool = pool; cbt.pool = pool;
if (globals.odbc_dsn) { if (!zstr(globals.odbc_dsn)) {
newsql = switch_event_expand_headers(event, sql); newsql = switch_event_expand_headers(event, sql);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "SQL: %s\n", newsql); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "SQL: %s\n", newsql);
if (cidlookup_execute_sql_callback(newsql, cidlookup_callback, &cbt, &err)) { if (cidlookup_execute_sql_callback(newsql, cidlookup_callback, &cbt, &err)) {
@ -655,8 +655,6 @@ static cid_data_t *do_lookup(switch_memory_pool_t *pool, switch_event_t *event,
SWITCH_STANDARD_APP(cidlookup_app_function) SWITCH_STANDARD_APP(cidlookup_app_function)
{ {
switch_status_t status = SWITCH_STATUS_SUCCESS;
char *argv[4] = { 0 }; char *argv[4] = { 0 };
int argc; int argc;
char *mydata = NULL; char *mydata = NULL;
@ -705,7 +703,7 @@ SWITCH_STANDARD_APP(cidlookup_app_function)
if (switch_string_var_check_const(cid->name)) { if (switch_string_var_check_const(cid->name)) {
switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name); switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name);
switch_goto_status(SWITCH_STATUS_GENERR, done); goto done;
} }
if (cid && channel) { if (cid && channel) {
@ -719,7 +717,6 @@ SWITCH_STANDARD_APP(cidlookup_app_function)
profile->caller_id_name = switch_core_strdup(profile->pool, cid->name);; profile->caller_id_name = switch_core_strdup(profile->pool, cid->name);;
} }
switch_goto_status(SWITCH_STATUS_SUCCESS, done);
done: done:
if (event) { if (event) {
@ -728,9 +725,6 @@ SWITCH_STANDARD_APP(cidlookup_app_function)
if (!session && pool) { if (!session && pool) {
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
} }
/* This is so compile doesn't failed because status is never used */
if (status) {
}
} }
SWITCH_STANDARD_API(cidlookup_function) SWITCH_STANDARD_API(cidlookup_function)