From dbf98a34e08558b91328cb414447e9961c222033 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 18 Sep 2021 14:25:22 +0100 Subject: Add JT recommended warnings --- libodbcpp/odbc-command.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libodbcpp/odbc-command.cpp') diff --git a/libodbcpp/odbc-command.cpp b/libodbcpp/odbc-command.cpp index c73b3f9..c3e181d 100644 --- a/libodbcpp/odbc-command.cpp +++ b/libodbcpp/odbc-command.cpp @@ -9,11 +9,12 @@ ODBC::Command::Command(const Connection & c, const std::string & s) : DB::Comman if (!SQL_SUCCEEDED(rc)) { throw Error(rc, SQL_HANDLE_STMT, hStmt); } - rc = SQLSetStmtAttr(hStmt, SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)SQL_CURSOR_DYNAMIC, 0); + rc = SQLSetStmtAttr(hStmt, SQL_ATTR_CURSOR_TYPE, reinterpret_cast(SQL_CURSOR_DYNAMIC), 0); if (!SQL_SUCCEEDED(rc)) { throw ConnectionError(rc, SQL_HANDLE_STMT, hStmt); } - rc = SQLPrepare(hStmt, (SQLCHAR *)sql.c_str(), sql.length()); + rc = SQLPrepare(hStmt, const_cast(reinterpret_cast(sql.data())), + static_cast(sql.length())); if (!SQL_SUCCEEDED(rc)) { SQLFreeHandle(SQL_HANDLE_STMT, hStmt); throw Error(rc, SQL_HANDLE_STMT, hStmt); @@ -24,5 +25,5 @@ ODBC::Command::Command(const Connection & c, const std::string & s) : DB::Comman SQLFreeHandle(SQL_HANDLE_STMT, hStmt); throw Error(rc, SQL_HANDLE_STMT, hStmt); } - params.resize(pcount); + params.resize(static_cast(pcount)); } -- cgit v1.2.3