summaryrefslogtreecommitdiff
path: root/cdr
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
commite6b2e9a7501b5d2e351a5e626fa13dfc3c113f1e (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /cdr
parent88bda581ec7c524050bca769c6705ee5c66357ad (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: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_adaptive_odbc.c5
-rw-r--r--cdr/cdr_sqlite.c2
-rw-r--r--cdr/cdr_sqlite3_custom.c4
3 files changed, 5 insertions, 6 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);
diff --git a/cdr/cdr_sqlite.c b/cdr/cdr_sqlite.c
index 98b6b7c4c..8eecee453 100644
--- a/cdr/cdr_sqlite.c
+++ b/cdr/cdr_sqlite.c
@@ -61,7 +61,7 @@ static sqlite* db = NULL;
AST_MUTEX_DEFINE_STATIC(sqlite_lock);
/*! \brief SQL table format */
-static char sql_create_table[] = "CREATE TABLE cdr ("
+static const char sql_create_table[] = "CREATE TABLE cdr ("
" AcctId INTEGER PRIMARY KEY,"
" clid VARCHAR(80),"
" src VARCHAR(80),"
diff --git a/cdr/cdr_sqlite3_custom.c b/cdr/cdr_sqlite3_custom.c
index 08b675225..3bd926268 100644
--- a/cdr/cdr_sqlite3_custom.c
+++ b/cdr/cdr_sqlite3_custom.c
@@ -56,8 +56,8 @@ AST_MUTEX_DEFINE_STATIC(lock);
static const char config_file[] = "cdr_sqlite3_custom.conf";
-static char *desc = "Customizable SQLite3 CDR Backend";
-static char *name = "cdr_sqlite3_custom";
+static const char desc[] = "Customizable SQLite3 CDR Backend";
+static const char name[] = "cdr_sqlite3_custom";
static sqlite3 *db = NULL;
static char table[80];