aboutsummaryrefslogtreecommitdiffstats
path: root/cdr/cdr_adaptive_odbc.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 21:13:09 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 21:13:09 +0000
commit230a66da7d98b2b6d328a04b0e7180b94d9c76bf (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /cdr/cdr_adaptive_odbc.c
parentd57c20e50d7105f72bb90e709965ad5e04c5e36a (diff)
Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr/cdr_adaptive_odbc.c')
-rw-r--r--cdr/cdr_adaptive_odbc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index 6c72d19c7..205c2075d 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -282,7 +282,6 @@ static int free_config(void)
static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
{
int res, i;
- char *sql = data;
SQLHSTMT stmt;
SQLINTEGER nativeerror = 0, numfields = 0;
SQLSMALLINT diagbytes = 0;
@@ -294,9 +293,9 @@ static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
return NULL;
}
- res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
+ res = SQLPrepare(stmt, (unsigned char *) data, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
+ ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", (char *) data);
SQLGetDiagField(SQL_HANDLE_STMT, stmt, 1, SQL_DIAG_NUMBER, &numfields, SQL_IS_INTEGER, &diagbytes);
for (i = 0; i < numfields; i++) {
SQLGetDiagRec(SQL_HANDLE_STMT, stmt, i + 1, state, &nativeerror, diagnostic, sizeof(diagnostic), &diagbytes);