summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-14 11:47:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-14 19:53:53 +0100
commit1205a4b77401eeb2270fe25193286066bb59d173 (patch)
treead15770fb976a95552605aff55ce25b56058bb5f /connectivity/source/drivers
parente0f06e60c6e8958bc508d24585189043888e0eb9 (diff)
New loplugin:consttobool
...to: "Find implicit conversions from non-'bool' constants (e.g., 'sal_False') to 'bool'". Due to how FALSE is defined as just #define FALSE (0) (i.e., a literal of type 'int') but TRUE is defined as #define TRUE (!FALSE) (i.e., an implicit conversion from 'int' to 'bool') in GLib (see the comment in ConstToBool::VisitImplicitCastExpr), we get more warnings about uses of 'TRUE' than of 'FALSE'. For example, in libreofficekit/source/gtk/lokdocview.cxx there is a warning about the 'TRUE' in g_main_context_iteration(nullptr, TRUE); but not about the 'FALSE' in g_main_context_iteration(nullptr, FALSE); (where the parameter of 'g_main_context_iteration' is of type 'gboolean'). Lets live with that asymmetry for now... (Besides the issues addressed directly in this commit, it also found the two bogus asserts at 7e09d08807b5ba2fd8b9831557752a415bdad562 "Fix useless assert(true) (which would never fire)" and 122a0be8ae480473bd1d7f35e197a2529f4621e3 "Fix useless assert(true) (which would never fire)", plus 5f0d6df7f57ae281fe161e61c7f25d67453fddd2 "Use two-argument form of static_assert".) Change-Id: Id77322de9f94b85a7b65608a03e0e9865d14467b Reviewed-on: https://gerrit.libreoffice.org/82667 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx4
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx8
2 files changed, 6 insertions, 6 deletions
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 5a7c1ebea4dd..d6d55c272bfa 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -415,7 +415,7 @@ public:
ESource *pSource = e_source_registry_ref_source(get_e_source_registry(), id);
EBookClient *pBook = pSource ? createClient (pSource) : nullptr;
- if (pBook && !e_client_open_sync (pBook, TRUE, nullptr, nullptr))
+ if (pBook && !e_client_open_sync (pBook, true, nullptr, nullptr))
{
g_object_unref (G_OBJECT (pBook));
pBook = nullptr;
@@ -541,7 +541,7 @@ public:
{
ESource *pSource = findSource (abname);
EBook *pBook = pSource ? e_book_new (pSource, nullptr) : nullptr;
- if (pBook && !e_book_open (pBook, TRUE, nullptr))
+ if (pBook && !e_book_open (pBook, true, nullptr))
{
g_object_unref (G_OBJECT (pBook));
pBook = nullptr;
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index e7f9dd6b794e..dc39832c1bd9 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -268,9 +268,9 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
pArgs[1] = whereAnalysis( parseTree->getChild( 2 ) );
if( SQL_ISTOKEN( parseTree->getChild( 1 ), OR ) )
- pResult = e_book_query_or( 2, pArgs, TRUE );
+ pResult = e_book_query_or( 2, pArgs, true );
else
- pResult = e_book_query_and( 2, pArgs, TRUE );
+ pResult = e_book_query_and( 2, pArgs, true );
}
// SQL =, !=
else if( SQL_ISRULE( parseTree, comparison_predicate ) )
@@ -328,7 +328,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
pResult = createTest( aColumnName, E_BOOK_QUERY_IS, aMatchString );
if ( pResult && ( pPrec->getNodeType() == SQLNodeType::NotEqual ) )
- pResult = e_book_query_not( pResult, TRUE );
+ pResult = e_book_query_not( pResult, true );
}
// SQL like
else if( SQL_ISRULE( parseTree, like_predicate ) )
@@ -372,7 +372,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
SAL_INFO( "connectivity.evoab2", "Plain contains '" << aMatchString << "'" );
pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString );
if( pResult && bNotLike )
- pResult = e_book_query_not( pResult, TRUE );
+ pResult = e_book_query_not( pResult, true );
}
else if( bNotLike )
{