diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-12 21:53:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-13 15:06:42 +0100 |
commit | 913d34ec6b8fdb2796f76ce90fee51ade2051189 (patch) | |
tree | 261aefa505e7d71ad38c9d5b2ae0cfe92e9738c8 /connectivity | |
parent | eea0879cdf1b40e6ce424dd97b58e2a84846ad79 (diff) |
Extend loplugin:salbool to loplugin:fakebool
...checking for unnecessary uses of more "fake bool" types.
In the past, some of the checks involving the types of variables or data
members, or the return types of functions, issued warnings that required
surrounding code to be changed too (e.g., when changing the signature of a
function whose address was taken). These checks have been tightened now to not
warn in such cases (which avoids warnings that require changes to additional
code, or changes that might even be impossible to make, at the cost of being
less aggressive about removing all unnecessary uses of those "fake bool" types).
Change-Id: I70eb75039817cda34ed611387ee27dc5f36a3e2e
Reviewed-on: https://gerrit.libreoffice.org/82554
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
8 files changed, 29 insertions, 29 deletions
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 28c7278f2010..5a7c1ebea4dd 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -255,7 +255,7 @@ getValue( EContact* pContact, sal_Int32 nColumnNum, GType nType, GValue* pStackV return false; GParamSpec* pSpec = pSpecs->pField; - gboolean bIsSplittedColumn = pSpecs->bIsSplittedValue; + bool bIsSplittedColumn = pSpecs->bIsSplittedValue; _out_rWasNull = true; if ( !pSpec || !pContact) diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index 2422f44bd299..35c020f4a738 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -536,7 +536,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference( bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) { m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName ); - jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) ); + bool out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) ); m_aLogger.log< const sal_Char*, bool>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out ); return out; } @@ -578,7 +578,7 @@ bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _p { m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument ); - jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) ); + bool out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) ); m_aLogger.log< const sal_Char*, bool >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out ); return out; @@ -990,7 +990,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType static const char* const pMethodName = "supportsConvert"; m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType ); - jboolean out( false ); + bool out( false ); SDBThreadAttach t; { @@ -1332,7 +1332,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_I static const char* const pMethodName = "supportsResultSetConcurrency"; m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency ); - jboolean out( false ); + bool out( false ); SDBThreadAttach t; { diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index f6ad7f1d279b..72f205995639 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -213,7 +213,7 @@ sal_Bool SAL_CALL java_sql_Statement_Base::execute( const OUString& sql ) ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); - jboolean out(false); + bool out(false); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!"); { createStatement(t.pEnv); diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 13f9c79da482..b3516a15f6ac 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -255,7 +255,7 @@ void java_lang_Object::obtainMethodId_throwRuntime(JNIEnv* _pEnv,const char* _pM bool java_lang_Object::callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const { - jboolean out( false ); + bool out( false ); SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethod: no Java environment anymore!" ); @@ -269,7 +269,7 @@ bool java_lang_Object::callBooleanMethod( const char* _pMethodName, jmethodID& _ bool java_lang_Object::callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const { - jboolean out( false ); + bool out( false ); SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethodWithIntArg: no Java environment anymore!" ); obtainMethodId_throwSQL(t.pEnv, _pMethodName,"(I)Z", _inout_MethodID); diff --git a/connectivity/source/drivers/jdbc/Reader.cxx b/connectivity/source/drivers/jdbc/Reader.cxx index 1c7bfe9660df..5f49db97f05b 100644 --- a/connectivity/source/drivers/jdbc/Reader.cxx +++ b/connectivity/source/drivers/jdbc/Reader.cxx @@ -78,7 +78,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( ) { if(m_buf) return 1; - jboolean out; + bool out; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!"); { diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx index b0d83965f2f3..ddaba5fc9e45 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx @@ -111,9 +111,9 @@ bool OPreparedResultSet::fetchResult() } for (sal_Int32 i = 0; i < m_nColumnCount; ++i) { - m_aMetaData[i].is_null = 0; + m_aMetaData[i].is_null = false; m_aMetaData[i].length = 0l; - m_aMetaData[i].error = 0; + m_aMetaData[i].error = false; m_aData[i].is_null = &m_aMetaData[i].is_null; m_aData[i].buffer_length = m_aFields[i].type == MYSQL_TYPE_BLOB ? 0 : m_aFields[i].length; diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx index e9082dfa05e9..902a1d93edb0 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx @@ -182,7 +182,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 parameter, const OUString& m_binds[nIndex].buffer_type = MYSQL_TYPE_STRING; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, stringie.getStr(), MYSQL_TYPE_STRING, stringie.getLength()); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; m_bindMetas[nIndex].length = stringie.getLength(); } @@ -228,7 +228,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 parameter, sal_Bool x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_TINY; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_TINY); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setByte(sal_Int32 parameter, sal_Int8 x) @@ -240,7 +240,7 @@ void SAL_CALL OPreparedStatement::setByte(sal_Int32 parameter, sal_Int8 x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_TINY; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_TINY); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData) @@ -258,7 +258,7 @@ void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_DATE; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_DATE); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal) @@ -276,7 +276,7 @@ void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_TIME; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_TIME); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTime& aVal) @@ -297,7 +297,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_DATETIME; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_DATETIME); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setDouble(sal_Int32 parameter, double x) @@ -309,7 +309,7 @@ void SAL_CALL OPreparedStatement::setDouble(sal_Int32 parameter, double x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_DOUBLE; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_DOUBLE); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setFloat(sal_Int32 parameter, float x) @@ -321,7 +321,7 @@ void SAL_CALL OPreparedStatement::setFloat(sal_Int32 parameter, float x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_FLOAT; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_FLOAT); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setInt(sal_Int32 parameter, sal_Int32 x) @@ -333,7 +333,7 @@ void SAL_CALL OPreparedStatement::setInt(sal_Int32 parameter, sal_Int32 x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_LONG; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_LONG); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setLong(sal_Int32 parameter, sal_Int64 aVal) @@ -345,7 +345,7 @@ void SAL_CALL OPreparedStatement::setLong(sal_Int32 parameter, sal_Int64 aVal) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_LONGLONG; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &aVal, MYSQL_TYPE_LONGLONG); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setNull(sal_Int32 parameter, sal_Int32 /*sqlType*/) @@ -355,7 +355,7 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 parameter, sal_Int32 /*sqlTy checkParameterIndex(parameter); const sal_Int32 nIndex = parameter - 1; - m_bindMetas[nIndex].is_null = 1; + m_bindMetas[nIndex].is_null = true; free(m_binds[nIndex].buffer); m_binds[nIndex].buffer = nullptr; } @@ -408,7 +408,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co { free(m_binds[nIndex].buffer); m_binds[nIndex].buffer = nullptr; - m_bindMetas[parameterIndex - 1].is_null = 1; + m_bindMetas[parameterIndex - 1].is_null = true; return; } @@ -433,7 +433,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co m_binds[nIndex].buffer_type = MYSQL_TYPE_DOUBLE; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &nValue, MYSQL_TYPE_DOUBLE, sValue.getLength()); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; break; } @@ -478,7 +478,7 @@ void SAL_CALL OPreparedStatement::setShort(sal_Int32 parameter, sal_Int16 x) const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_SHORT; mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_SHORT); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence<sal_Int8>& x) @@ -490,7 +490,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence<s const sal_Int32 nIndex = parameter - 1; m_binds[nIndex].buffer_type = MYSQL_TYPE_BLOB; // FIXME mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_BLOB); - m_bindMetas[nIndex].is_null = 0; + m_bindMetas[nIndex].is_null = false; } void SAL_CALL OPreparedStatement::setCharacterStream(sal_Int32 parameter, @@ -524,7 +524,7 @@ void SAL_CALL OPreparedStatement::clearParameters() for (size_t i = 0; i < m_binds.size(); ++i) { - m_bindMetas[i].is_null = 1; + m_bindMetas[i].is_null = true; free(m_binds[i].buffer); m_binds[i].buffer = nullptr; } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx index 660fd17de2b2..f488e285bc41 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx @@ -47,9 +47,9 @@ using my_bool = char; struct BindMetaData { - my_bool is_null = 0; + my_bool is_null = false; unsigned long length = 0; - my_bool error = 0; + my_bool error = false; }; typedef ::cppu::ImplHelper5<css::sdbc::XPreparedStatement, css::sdbc::XParameters, |