summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-06-11 15:23:30 +0000
committerKinsey Moore <kmoore@digium.com>2012-06-11 15:23:30 +0000
commitc6142cf2cc7312122abcf74d6ab1daf0ad1d72bf (patch)
tree3d00ae5c1e40b99710f72f10a1f65d62ce83b01d /res
parent566ea22e1878ad6a576431d1035a5fe9b4a936d1 (diff)
Fix coverity UNUSED_VALUE findings in core support level files
Most of these were just saving returned values without using them and in some cases the variable being saved to could be removed as well. (issue ASTERISK-19672) ........ Merged revisions 368738 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368739 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_config_odbc.c7
-rw-r--r--res/res_fax.c2
-rw-r--r--res/res_odbc.c2
-rw-r--r--res/res_speech.c3
4 files changed, 6 insertions, 8 deletions
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c
index 46922835f..66e15a02b 100644
--- a/res/res_config_odbc.c
+++ b/res/res_config_odbc.c
@@ -518,7 +518,7 @@ static int update_odbc(const char *database, const char *table, const char *keyf
}
va_arg(aq, const char *);
- if (tableptr && !(column = ast_odbc_find_column(tableptr, newparam))) {
+ if (tableptr && !ast_odbc_find_column(tableptr, newparam)) {
ast_log(LOG_WARNING, "Key field '%s' does not exist in table '%s@%s'. Update will fail\n", newparam, table, database);
}
@@ -587,7 +587,6 @@ static SQLHSTMT update2_prepare(struct odbc_obj *obj, void *data)
SQLHSTMT stmt;
va_list ap;
struct odbc_cache_tables *tableptr = ast_odbc_find_table(ups->database, ups->table);
- struct odbc_cache_columns *column;
if (!sql) {
if (tableptr) {
@@ -619,7 +618,7 @@ static SQLHSTMT update2_prepare(struct odbc_obj *obj, void *data)
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
- if ((column = ast_odbc_find_column(tableptr, newparam))) {
+ if (ast_odbc_find_column(tableptr, newparam)) {
ast_str_append(&sql, 0, "%s%s=? ", first ? "" : ", ", newparam);
SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(newval), 0, (void *)newval, 0, NULL);
first = 0;
@@ -637,7 +636,7 @@ static SQLHSTMT update2_prepare(struct odbc_obj *obj, void *data)
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
- if (!(column = ast_odbc_find_column(tableptr, newparam))) {
+ if (!ast_odbc_find_column(tableptr, newparam)) {
va_end(ap);
ast_log(LOG_ERROR, "One or more of the criteria columns '%s' on '%s@%s' for this update does not exist!\n", newparam, ups->table, ups->database);
ast_odbc_release_table(tableptr);
diff --git a/res/res_fax.c b/res/res_fax.c
index 7b628d364..50c1c368d 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -583,7 +583,7 @@ static int update_modem_bits(enum ast_fax_modems *bits, const char *value)
char *m[5], *tok, *v = (char *)value;
int i = 0, j;
- if (!(tok = strchr(v, ','))) {
+ if (!strchr(v, ',')) {
m[i++] = v;
m[i] = NULL;
} else {
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 39475e98e..3afa088da 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -1628,7 +1628,7 @@ static int acf_transaction_write(struct ast_channel *chan, const char *cmd, char
pbx_builtin_setvar_helper(chan, "ODBC_RESULT", "INVALID_DB");
return -1;
}
- if (!(tx = find_transaction(chan, obj, value, 0))) {
+ if (!find_transaction(chan, obj, value, 0)) {
pbx_builtin_setvar_helper(chan, "ODBC_RESULT", "FAILED_TO_CREATE");
return -1;
}
diff --git a/res/res_speech.c b/res/res_speech.c
index de0c41e08..e6fdab9d0 100644
--- a/res/res_speech.c
+++ b/res/res_speech.c
@@ -276,7 +276,6 @@ int ast_speech_change_results_type(struct ast_speech *speech, enum ast_speech_re
/*! \brief Register a speech recognition engine */
int ast_speech_register(struct ast_speech_engine *engine)
{
- struct ast_speech_engine *existing_engine = NULL;
int res = 0;
/* Confirm the engine meets the minimum API requirements */
@@ -286,7 +285,7 @@ int ast_speech_register(struct ast_speech_engine *engine)
}
/* If an engine is already loaded with this name, error out */
- if ((existing_engine = find_engine(engine->name))) {
+ if (find_engine(engine->name)) {
ast_log(LOG_WARNING, "Speech recognition engine '%s' already exists.\n", engine->name);
return -1;
}