diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-05-01 03:21:29 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-05-01 03:21:29 +0000 |
commit | 54e7a94d7005ed8da0707154d3606dec96732ac9 (patch) | |
tree | 9e0e90b2ea8282fa3a23ba548f812c73e3d8979e /gtk | |
parent | f1919c706f275e457dcf04eaca1cc417a8f34da0 (diff) | |
download | gtk+-54e7a94d7005ed8da0707154d3606dec96732ac9.tar.gz |
builder: Fix signedness issues in apis
Whenever we take a length argument that can
be -1 for 'nul-terminated', it should be
gssize, not gsize.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1555
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbuilder.c | 14 | ||||
-rw-r--r-- | gtk/gtkbuilder.h | 6 | ||||
-rw-r--r-- | gtk/gtkbuilderparser.c | 2 | ||||
-rw-r--r-- | gtk/gtkbuilderprivate.h | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index bac38f2aca..2f5ba245e9 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -1094,7 +1094,7 @@ gtk_builder_add_from_file (GtkBuilder *builder, priv->resource_prefix = NULL; _gtk_builder_parser_parse_buffer (builder, filename, - buffer, length, + buffer, (gssize)length, NULL, &tmp_error); @@ -1160,7 +1160,7 @@ gtk_builder_add_objects_from_file (GtkBuilder *builder, priv->resource_prefix = NULL; _gtk_builder_parser_parse_buffer (builder, filename, - buffer, length, + buffer, (gssize)length, object_ids, &tmp_error); @@ -1198,7 +1198,7 @@ gtk_builder_extend_with_template (GtkBuilder *builder, GtkWidget *widget, GType template_type, const gchar *buffer, - gsize length, + gssize length, GError **error) { GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder); @@ -1394,7 +1394,7 @@ gtk_builder_add_objects_from_resource (GtkBuilder *builder, * * Most users will probably want to use gtk_builder_new_from_string(). * - * Upon errors 0 will be returned and @error will be assigned a + * Upon errors %FALSE will be returned and @error will be assigned a * #GError from the #GTK_BUILDER_ERROR, #G_MARKUP_ERROR or * #G_VARIANT_PARSE_ERROR domain. * @@ -1407,7 +1407,7 @@ gtk_builder_add_objects_from_resource (GtkBuilder *builder, gboolean gtk_builder_add_from_string (GtkBuilder *builder, const gchar *buffer, - gsize length, + gssize length, GError **error) { GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder); @@ -1449,7 +1449,7 @@ gtk_builder_add_from_string (GtkBuilder *builder, * building only the requested objects and merges * them with the current contents of @builder. * - * Upon errors 0 will be returned and @error will be assigned a + * Upon errors %FALSE will be returned and @error will be assigned a * #GError from the #GTK_BUILDER_ERROR or #G_MARKUP_ERROR domain. * * If you are adding an object that depends on an object that is not @@ -1461,7 +1461,7 @@ gtk_builder_add_from_string (GtkBuilder *builder, gboolean gtk_builder_add_objects_from_string (GtkBuilder *builder, const gchar *buffer, - gsize length, + gssize length, gchar **object_ids, GError **error) { diff --git a/gtk/gtkbuilder.h b/gtk/gtkbuilder.h index d739e5158f..e28655dbf6 100644 --- a/gtk/gtkbuilder.h +++ b/gtk/gtkbuilder.h @@ -128,7 +128,7 @@ gboolean gtk_builder_add_from_resource (GtkBuilder *builder, GDK_AVAILABLE_IN_ALL gboolean gtk_builder_add_from_string (GtkBuilder *builder, const gchar *buffer, - gsize length, + gssize length, GError **error); GDK_AVAILABLE_IN_ALL gboolean gtk_builder_add_objects_from_file (GtkBuilder *builder, @@ -143,7 +143,7 @@ gboolean gtk_builder_add_objects_from_resource(GtkBuilder *builder, GDK_AVAILABLE_IN_ALL gboolean gtk_builder_add_objects_from_string (GtkBuilder *builder, const gchar *buffer, - gsize length, + gssize length, gchar **object_ids, GError **error); GDK_AVAILABLE_IN_ALL @@ -228,7 +228,7 @@ gboolean gtk_builder_extend_with_template (GtkBuilder *builder, GtkWidget *widget, GType template_type, const gchar *buffer, - gsize length, + gssize length, GError **error); G_END_DECLS diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c index 2c08df0f02..fc1c80db28 100644 --- a/gtk/gtkbuilderparser.c +++ b/gtk/gtkbuilderparser.c @@ -1230,7 +1230,7 @@ void _gtk_builder_parser_parse_buffer (GtkBuilder *builder, const gchar *filename, const gchar *buffer, - gsize length, + gssize length, gchar **requested_objs, GError **error) { diff --git a/gtk/gtkbuilderprivate.h b/gtk/gtkbuilderprivate.h index 5b71bdf76d..29c2086ca4 100644 --- a/gtk/gtkbuilderprivate.h +++ b/gtk/gtkbuilderprivate.h @@ -135,7 +135,7 @@ typedef GType (*GTypeGetFunc) (void); void _gtk_builder_parser_parse_buffer (GtkBuilder *builder, const gchar *filename, const gchar *buffer, - gsize length, + gssize length, gchar **requested_objs, GError **error); GObject * _gtk_builder_construct (GtkBuilder *builder, |