summaryrefslogtreecommitdiff
path: root/libgjs-private
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2019-08-15 01:30:48 +0200
committerFlorian Müllner <fmuellner@gnome.org>2019-08-15 00:54:47 +0000
commitc913377357778bd68b3ac132302a9c144ec553c0 (patch)
treecc192cda7f3b9780bff31d1760f20c86a4356cc5 /libgjs-private
parent332efe2e48017bd3a8785d4b6f13177501b4c6b5 (diff)
downloadgjs-c913377357778bd68b3ac132302a9c144ec553c0.tar.gz
gtk-util: Reformat
We are about to make changes here, so make sure we start from a style that the tooling accepts in order to not mix stylistic and functional changes in the same commit.
Diffstat (limited to 'libgjs-private')
-rw-r--r--libgjs-private/gjs-gtk-util.c47
-rw-r--r--libgjs-private/gjs-gtk-util.h8
2 files changed, 26 insertions, 29 deletions
diff --git a/libgjs-private/gjs-gtk-util.c b/libgjs-private/gjs-gtk-util.c
index 55840a6f..8694a847 100644
--- a/libgjs-private/gjs-gtk-util.c
+++ b/libgjs-private/gjs-gtk-util.c
@@ -28,37 +28,34 @@
#include "libgjs-private/gjs-gtk-util.h"
-void
-gjs_gtk_container_child_set_property (GtkContainer *container,
- GtkWidget *child,
- const gchar *property,
- const GValue *value)
-{
- GParamSpec *pspec;
+void gjs_gtk_container_child_set_property(GtkContainer* container,
+ GtkWidget* child,
+ const char* property,
+ const GValue* value) {
+ GParamSpec* pspec;
- pspec = gtk_container_class_find_child_property (G_OBJECT_GET_CLASS (container),
- property);
+ pspec = gtk_container_class_find_child_property(
+ G_OBJECT_GET_CLASS(container), property);
if (pspec == NULL) {
- g_warning ("%s does not have a property called %s",
- g_type_name (G_OBJECT_TYPE (container)), property);
- return;
+ g_warning("%s does not have a property called %s",
+ g_type_name(G_OBJECT_TYPE(container)), property);
+ return;
}
- if ((G_VALUE_TYPE (value) == G_TYPE_POINTER) &&
- (g_value_get_pointer (value) == NULL) &&
- !g_value_type_transformable (G_VALUE_TYPE (value), pspec->value_type)) {
- /* Set an empty value. This will happen when we set a NULL value from JS.
- * Since GJS doesn't know the GParamSpec for this property, it
- * will just put NULL into a G_TYPE_POINTER GValue, which will later
- * fail when trying to transform it to the GParamSpec's GType.
+ if ((G_VALUE_TYPE(value) == G_TYPE_POINTER) &&
+ (g_value_get_pointer(value) == NULL) &&
+ !g_value_type_transformable(G_VALUE_TYPE(value), pspec->value_type)) {
+ /* Set an empty value. This will happen when we set a NULL value from
+ * JS. Since GJS doesn't know the GParamSpec for this property, it will
+ * just put NULL into a G_TYPE_POINTER GValue, which will later fail
+ * when trying to transform it to the GParamSpec's GType.
*/
GValue null_value = G_VALUE_INIT;
- g_value_init (&null_value, pspec->value_type);
- gtk_container_child_set_property (container, child,
- property, &null_value);
- g_value_unset (&null_value);
+ g_value_init(&null_value, pspec->value_type);
+ gtk_container_child_set_property(container, child, property,
+ &null_value);
+ g_value_unset(&null_value);
} else {
- gtk_container_child_set_property (container, child,
- property, value);
+ gtk_container_child_set_property(container, child, property, value);
}
}
diff --git a/libgjs-private/gjs-gtk-util.h b/libgjs-private/gjs-gtk-util.h
index e2785004..e523378c 100644
--- a/libgjs-private/gjs-gtk-util.h
+++ b/libgjs-private/gjs-gtk-util.h
@@ -36,10 +36,10 @@
G_BEGIN_DECLS
GJS_EXPORT
-void gjs_gtk_container_child_set_property (GtkContainer *container,
- GtkWidget *child,
- const gchar *property,
- const GValue *value);
+void gjs_gtk_container_child_set_property(GtkContainer* container,
+ GtkWidget* child,
+ const char* property,
+ const GValue* value);
G_END_DECLS