Skip to content

Commit 12bbb58

Browse files
committed
Replace remaining std::wstring uses with std::u16string
1 parent 1b9df47 commit 12bbb58

File tree

5 files changed

+98
-394
lines changed

5 files changed

+98
-394
lines changed

mssql_python/pybind/connection/connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void Connection::connect(const py::dict& attrs_before) {
7474
setAutocommit(_autocommit);
7575
}
7676
}
77-
SQLWCHAR* connStrPtr = const_cast<SQLWCHAR*>(reinterpretU16stringAsSqlWChar(_connStr));
77+
SQLWCHAR* connStrPtr = reinterpretU16stringAsSqlWChar(_connStr);
7878
SQLRETURN ret;
7979
{
8080
// Release the GIL during the blocking ODBC connect call.
@@ -292,7 +292,7 @@ SQLRETURN Connection::setAttribute(SQLINTEGER attribute, py::object value) {
292292
SQLPOINTER ptr;
293293
SQLINTEGER length;
294294

295-
ptr = const_cast<SQLWCHAR*>(reinterpretU16stringAsSqlWChar(this->wstrStringBuffer));
295+
ptr = reinterpretU16stringAsSqlWChar(this->wstrStringBuffer);
296296
length = static_cast<SQLINTEGER>(this->wstrStringBuffer.length() * sizeof(SQLWCHAR));
297297

298298
SQLRETURN ret = SQLSetConnectAttr_ptr(_dbcHandle->get(), attribute, ptr, length);

0 commit comments

Comments
 (0)