Commit 612050e5 authored by Brian R. Toonen's avatar Brian R. Toonen

eliminated compiler warnings

parent 3cad1c87
......@@ -108,7 +108,9 @@ db2_session_backend::db2_session_backend(
}
/* Connect to database */
cliRC = SQLConnect(hDbc,(SQLCHAR*)dsn.c_str(),SQL_NTS,(SQLCHAR*)username.c_str(),SQL_NTS,(SQLCHAR*)password.c_str(),SQL_NTS);
cliRC = SQLConnect(hDbc, const_cast<SQLCHAR *>((const SQLCHAR *) dsn.c_str()), SQL_NTS,
const_cast<SQLCHAR *>((const SQLCHAR *) username.c_str()), SQL_NTS,
const_cast<SQLCHAR *>((const SQLCHAR *) password.c_str()), SQL_NTS);
if (cliRC != SQL_SUCCESS) {
std::string msg=db2_soci_error::sqlState("Error connecting to database",SQL_HANDLE_DBC,hDbc);
SQLFreeHandle(SQL_HANDLE_DBC,hDbc);
......
......@@ -107,7 +107,7 @@ struct SOCI_DB2_DECL db2_vector_into_type_backend : details::vector_into_type_ba
struct SOCI_DB2_DECL db2_standard_use_type_backend : details::standard_use_type_backend
{
db2_standard_use_type_backend(db2_statement_backend &st)
: statement_(st),buf(NULL),indptr(NULL)
: statement_(st),buf(NULL),ind(0)
{}
void bind_by_pos(int& position, void* data, details::exchange_type type, bool readOnly);
......@@ -128,7 +128,7 @@ struct SOCI_DB2_DECL db2_standard_use_type_backend : details::standard_use_type_
int position;
std::string name;
char* buf;
SQLLEN indptr;
SQLLEN ind;
};
struct SOCI_DB2_DECL db2_vector_use_type_backend : details::vector_use_type_backend
......
......@@ -55,7 +55,7 @@ void db2_standard_use_type_backend::prepare_for_bind(
size = sizeof(char) + 1;
buf = new char[size];
data = buf;
indptr = SQL_NTS;
ind = SQL_NTS;
break;
case x_stdstring:
{
......@@ -67,7 +67,7 @@ void db2_standard_use_type_backend::prepare_for_bind(
size = s->size() + 1;
buf = new char[size];
data = buf;
indptr = SQL_NTS;
ind = SQL_NTS;
}
break;
case x_stdtm:
......@@ -102,7 +102,7 @@ void db2_standard_use_type_backend::bind_helper(int &position, void *data, detai
SQLRETURN cliRC = SQLBindParameter(statement_.hStmt,
static_cast<SQLUSMALLINT>(position++),
SQL_PARAM_INPUT,
cType, sqlType, size, 0, data, size, &indptr);
cType, sqlType, size, 0, data, size, &ind);
if (cliRC != SQL_SUCCESS)
{
......@@ -146,7 +146,7 @@ void db2_standard_use_type_backend::bind_by_name(
}
}
void db2_standard_use_type_backend::pre_use(indicator const *ind)
void db2_standard_use_type_backend::pre_use(indicator const *ind_ptr)
{
// first deal with data
if (type == x_char)
......@@ -180,9 +180,9 @@ void db2_standard_use_type_backend::pre_use(indicator const *ind)
}
// then handle indicators
if (ind != NULL && *ind == i_null)
if (ind_ptr != NULL && *ind_ptr == i_null)
{
indptr = SQL_NULL_DATA; // null
ind = SQL_NULL_DATA; // null
}
}
......
......@@ -131,7 +131,7 @@ void db2_statement_backend::prepare(std::string const & query ,
query_ += ss.str();
}
SQLRETURN cliRC = SQLPrepare(hStmt,(SQLCHAR*)query_.c_str(),SQL_NTS);
SQLRETURN cliRC = SQLPrepare(hStmt, const_cast<SQLCHAR *>((const SQLCHAR *) query_.c_str()), SQL_NTS);
if (cliRC!=SQL_SUCCESS) {
throw db2_soci_error("Error while preparing query",cliRC);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment