diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-14 11:47:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-14 19:53:53 +0100 |
commit | 1205a4b77401eeb2270fe25193286066bb59d173 (patch) | |
tree | ad15770fb976a95552605aff55ce25b56058bb5f /vcl/unx/gtk3/gtk3gtkframe.cxx | |
parent | e0f06e60c6e8958bc508d24585189043888e0eb9 (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 'vcl/unx/gtk3/gtk3gtkframe.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 4c4005dc9a7c..8ec93277e1a0 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -502,7 +502,7 @@ static bool ensure_dbus_setup( gpointer data ) pSessionBus = g_bus_get_sync (G_BUS_TYPE_SESSION, nullptr, nullptr); if( !pSessionBus ) { - return FALSE; + return false; } // Create menu model and action group attached to this frame. @@ -551,7 +551,7 @@ static bool ensure_dbus_setup( gpointer data ) g_free( aDBusMenubarPath ); } - return FALSE; + return false; } void on_registrar_available( GDBusConnection * /*connection*/, @@ -1773,7 +1773,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect { // temporarily re-sizeable if( !(m_nStyle & SalFrameStyleFlags::SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), true ); window_resize(nWidth, nHeight); } |