From 5072e01d077122741f71bef30c4b5caf88fe7793 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 12 Jan 2018 20:19:40 +0100 Subject: More loplugin:cstylecast: mysqlc auto-rewrite with "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I4bc61dbaf5d920e75269564cd92b19ae05046ca6 --- mysqlc/source/mysqlc_connection.cxx | 2 +- mysqlc/source/mysqlc_preparedstatement.cxx | 2 +- mysqlc/source/mysqlc_resultset.cxx | 4 ++-- mysqlc/source/mysqlc_resultsetmetadata.cxx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx index f44fca89e205..65984285b81b 100644 --- a/mysqlc/source/mysqlc_connection.cxx +++ b/mysqlc/source/mysqlc_connection.cxx @@ -161,7 +161,7 @@ void OConnection::construct(const rtl::OUString& url, const Sequence< PropertyVa connProps["userName"] = sql::ConnectPropertyVal(user_str); connProps["password"] = sql::ConnectPropertyVal(pass_str); connProps["schema"] = sql::ConnectPropertyVal(schema_str); - connProps["port"] = sql::ConnectPropertyVal((int)nPort); + connProps["port"] = sql::ConnectPropertyVal(static_cast(nPort)); if (unixSocketPassed) { sql::SQLString socket_str = rtl::OUStringToOString(sUnixSocket, m_settings.encoding).getStr(); connProps["socket"] = socket_str; diff --git a/mysqlc/source/mysqlc_preparedstatement.cxx b/mysqlc/source/mysqlc_preparedstatement.cxx index ec5b6f68bdb0..4be52eb018d1 100644 --- a/mysqlc/source/mysqlc_preparedstatement.cxx +++ b/mysqlc/source/mysqlc_preparedstatement.cxx @@ -726,7 +726,7 @@ void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,cons void OPreparedStatement::checkParameterIndex(sal_Int32 column) { - if (column < 1 || column > (sal_Int32) m_paramCount) { + if (column < 1 || column > static_cast(m_paramCount)) { throw SQLException("Parameter index out of range", *this, rtl::OUString(), 1, Any ()); } } diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx index 7911bba8fd12..faa9357f3cae 100644 --- a/mysqlc/source/mysqlc_resultset.cxx +++ b/mysqlc/source/mysqlc_resultset.cxx @@ -380,7 +380,7 @@ sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 column) checkDisposed(OResultSet_BASE::rBHelper.bDisposed); try { - return (sal_Int16) m_result->getInt(column); + return static_cast(m_result->getInt(column)); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding); } @@ -1043,7 +1043,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OResultSet::getProp void OResultSet::checkColumnIndex(sal_Int32 index) { - if (index < 1 || index > (int) fieldCount) { + if (index < 1 || index > static_cast(fieldCount)) { /* static object for efficiency or thread safety is a problem ? */ throw SQLException("index out of range", *this, rtl::OUString(), 1, Any()); } diff --git a/mysqlc/source/mysqlc_resultsetmetadata.cxx b/mysqlc/source/mysqlc_resultsetmetadata.cxx index 1c4472f393eb..d7a7054ea100 100644 --- a/mysqlc/source/mysqlc_resultsetmetadata.cxx +++ b/mysqlc/source/mysqlc_resultsetmetadata.cxx @@ -323,7 +323,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isWritable(sal_Int32 column) void OResultSetMetaData::checkColumnIndex(sal_Int32 columnIndex) { - if (columnIndex < 1 || columnIndex > (sal_Int32) meta->getColumnCount()) { + if (columnIndex < 1 || columnIndex > static_cast(meta->getColumnCount())) { rtl::OUStringBuffer buf; buf.appendAscii( "Column index out of range (expected 1 to " ); -- cgit