[X2Go-Commits] [libx2goclient] 06/09: src/x2goclient-utils.c: replace _Bool* parameters with gboolean* for gobject-introspection only.
git-admin at x2go.org
git-admin at x2go.org
Wed May 13 16:41:35 CEST 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository libx2goclient.
commit 9033b62931a32db0a2d0af3f1afc2493cb862af7
Author: Mihai Moldovan <ionic at ionic.de>
Date: Thu Apr 30 23:59:19 2020 +0200
src/x2goclient-utils.c: replace _Bool* parameters with gboolean* for gobject-introspection only.
stdbool, also called _Bool, is a standard type as of C99, but for some
reason inexpressible in GIRepository format, c.f.,
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/24
.
Older versions of gobject-introspection mapped _Bool to gboolean, but as
of the previously mentioned PR, this is not the case any longer. The PR
that got merged in the end is
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/45
, which removed this mapping, but at the same time also added a new one
from _Bool to a basic type.
This may sound weird at first, but has emerged out of the situation that
they wanted to retain compatibility with _Bool in general.
What this leads to can be seen here: while _Bool-type function
parameters will work fine with gobject-introspection, derived types such
as _Bool* will generate warnings.
We can override the type to gboolean* in such cases, because function
parameters are typically widened and not narrowed, so a wider type
should work equally fine - both on big endian and little endian
platforms. Additionally, this is a pointer, and all pointers are
fixed-sized.
However, care must be taken when actually reading from or writing to
this location, as different sizes and endian values might lead to
strange effects.
---
src/x2goclient-utils.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c
index 882e43e..8370360 100644
--- a/src/x2goclient-utils.c
+++ b/src/x2goclient-utils.c
@@ -44,11 +44,15 @@ void x2goclient_clear_strings (gpointer data) {
* @limit_max: (in): the maximum limit to check for
* @end: (out) (optional) (nullable): pointer to final string after the scanned
* value
- * @conv_err: (out) (not nullable): will be set to true on conversion errors
- * @min_err: (out) (not nullable): will be set to true if value falls short of
- * minimum limit and on underflows
- * @max_err: (out) (not nullable): will be set to true if value exceeds maximum
- * limit and on overflows
+ * @conv_err: (out) (not nullable) (type gboolean*): will be set to true on
+ * conversion errors
+ * @min_err: (out) (not nullable) (type gboolean*): will be set to true if
+ * value falls short of
+ * minimum limit and on
+ * underflows
+ * @max_err: (out) (not nullable) (type gboolean*): will be set to true if
+ * value exceeds maximum limit
+ * and on overflows
*
* Takes a string and converts it into a #long long integer.
*
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
More information about the x2go-commits
mailing list