[gedit] utils: remove GBOOLEAN_TO_POINTER() and GPOINTER_TO_BOOLEAN()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] utils: remove GBOOLEAN_TO_POINTER() and GPOINTER_TO_BOOLEAN()
- Date: Wed, 18 Mar 2020 15:36:18 +0000 (UTC)
commit 9ab7b0f0a6a109b2065e3bb14d2e02cb80b4f8dd
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Mar 18 16:23:06 2020 +0100
utils: remove GBOOLEAN_TO_POINTER() and GPOINTER_TO_BOOLEAN()
Those two public symbols caused the following build warnings:
../gedit/gedit-utils.h:31: Warning: Gedit: symbol='GBOOLEAN_TO_POINTER':
Unknown namespace for symbol 'GBOOLEAN_TO_POINTER'
../gedit/gedit-utils.h:32: Warning: Gedit: symbol='GPOINTER_TO_BOOLEAN':
Unknown namespace for symbol 'GPOINTER_TO_BOOLEAN'
Move those macros in the single file where it is used. I've checked that
it's not used in gedit-plugins.
As a replacement, you can simply use GINT_TO_POINTER() and
GPOINTER_TO_INT() provided by the GLib. A gboolean is a gint.
Nowadays instead of using g_object_set_data() in gedit-commands-file.c,
a GTask could be used, where the gboolean can be stored in a proper
struct.
docs/reference/api-breaks.xml | 7 +++++++
docs/reference/gedit-sections.txt | 2 --
gedit/gedit-commands-file.c | 4 ++++
gedit/gedit-utils.h | 4 ----
4 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/docs/reference/api-breaks.xml b/docs/reference/api-breaks.xml
index 267f65e23..8c337c106 100644
--- a/docs/reference/api-breaks.xml
+++ b/docs/reference/api-breaks.xml
@@ -36,6 +36,13 @@
<code>gedit_app_get_lockdown()</code> function has been removed.
</para>
</listitem>
+ <listitem>
+ <para>
+ The <code>GBOOLEAN_TO_POINTER()</code> and
+ <code>GPOINTER_TO_BOOLEAN()</code> macros have been removed from
+ <code>gedit-utils.h</code>.
+ </para>
+ </listitem>
</itemizedlist>
</refsect1>
diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt
index 2dc7dd874..289e71402 100644
--- a/docs/reference/gedit-sections.txt
+++ b/docs/reference/gedit-sections.txt
@@ -346,8 +346,6 @@ gedit_menu_extension_get_type
<SECTION>
<FILE>gedit-utils</FILE>
-GBOOLEAN_TO_POINTER
-GPOINTER_TO_BOOLEAN
gedit_utils_menu_position_under_tree_view
gedit_utils_set_atk_name_description
gedit_warning
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index a1b26433e..f8544b2d0 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -45,6 +45,10 @@
#include "gedit-file-chooser-dialog.h"
#include "gedit-close-confirmation-dialog.h"
+/* useful macro */
+#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1))
+#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT(i) == 2) ? TRUE : FALSE))
+
#define GEDIT_OPEN_DIALOG_KEY "gedit-open-dialog-key"
#define GEDIT_IS_CLOSING_ALL "gedit-is-closing-all"
#define GEDIT_NOTEBOOK_TO_CLOSE "gedit-notebook-to-close"
diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h
index d6f324c3e..565b500d3 100644
--- a/gedit/gedit-utils.h
+++ b/gedit/gedit-utils.h
@@ -27,10 +27,6 @@
G_BEGIN_DECLS
-/* useful macro */
-#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1))
-#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT(i) == 2) ? TRUE : FALSE))
-
enum { GEDIT_ALL_WORKSPACES = 0xffffffff };
gboolean gedit_utils_menu_position_under_tree_view (GtkTreeView *tree_view,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]