diff options
author | Brad King <brad.king@kitware.com> | 2016-05-17 13:33:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-17 13:33:02 (GMT) |
commit | 7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (patch) | |
tree | 2bdcf15abfef8e197173b5a135fe6b8391e43316 /Tests/FindGTK2/gobject/main.c | |
parent | 930ac45cbafca79eec9ae68e07c547b5c81b8c2c (diff) | |
parent | d9fd2f5402eeaa345691313658e02b51038f570b (diff) | |
download | CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.zip CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.gz CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.bz2 |
Merge topic 'clang-format-source'
d9fd2f54 Revise C++ coding style using clang-format
82df6dea Empty commit at end of history preceding clang-format style transition
6a13f43f CONTRIBUTING: Add a section on coding style
bf451d9f Add a script to run clang-format on the entire source tree
1e90d78f Configure clang-format for CMake source tree
da60adc3 Tell Git to use a distinct conflict marker size in `.rst` files
Diffstat (limited to 'Tests/FindGTK2/gobject/main.c')
-rw-r--r-- | Tests/FindGTK2/gobject/main.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/Tests/FindGTK2/gobject/main.c b/Tests/FindGTK2/gobject/main.c index d3e13f9..46e2127 100644 --- a/Tests/FindGTK2/gobject/main.c +++ b/Tests/FindGTK2/gobject/main.c @@ -1,18 +1,21 @@ -/* Taken from https://developer.gnome.org/gobject/stable/chapter-gobject.html */ - +/* Taken from https://developer.gnome.org/gobject/stable/chapter-gobject.html + */ #include <glib-object.h> +#define MAMAN_TYPE_BAR (maman_bar_get_type()) +#define MAMAN_BAR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), MAMAN_TYPE_BAR, MamanBar)) +#define MAMAN_IS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAMAN_TYPE_BAR)) +#define MAMAN_BAR_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), MAMAN_TYPE_BAR, MamanBarClass)) +#define MAMAN_IS_BAR_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), MAMAN_TYPE_BAR)) +#define MAMAN_BAR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), MAMAN_TYPE_BAR, MamanBarClass)) -#define MAMAN_TYPE_BAR (maman_bar_get_type ()) -#define MAMAN_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_BAR, MamanBar)) -#define MAMAN_IS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_BAR)) -#define MAMAN_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAMAN_TYPE_BAR, MamanBarClass)) -#define MAMAN_IS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAMAN_TYPE_BAR)) -#define MAMAN_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAMAN_TYPE_BAR, MamanBarClass)) - -typedef struct _MamanBar MamanBar; -typedef struct _MamanBarClass MamanBarClass; +typedef struct _MamanBar MamanBar; +typedef struct _MamanBarClass MamanBarClass; struct _MamanBar { @@ -29,18 +32,17 @@ struct _MamanBarClass }; /* will create maman_bar_get_type and set maman_bar_parent_class */ -G_DEFINE_TYPE (MamanBar, maman_bar, G_TYPE_OBJECT); +G_DEFINE_TYPE(MamanBar, maman_bar, G_TYPE_OBJECT); -static GObject * -maman_bar_constructor (GType gtype, - guint n_properties, - GObjectConstructParam *properties) +static GObject* maman_bar_constructor(GType gtype, guint n_properties, + GObjectConstructParam* properties) { - GObject *obj; + GObject* obj; { /* Always chain up to the parent constructor */ - obj = G_OBJECT_CLASS (maman_bar_parent_class)->constructor (gtype, n_properties, properties); + obj = G_OBJECT_CLASS(maman_bar_parent_class) + ->constructor(gtype, n_properties, properties); } /* update the object state depending on constructor properties */ @@ -48,25 +50,21 @@ maman_bar_constructor (GType gtype, return obj; } -static void -maman_bar_class_init (MamanBarClass *klass) +static void maman_bar_class_init(MamanBarClass* klass) { - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GObjectClass* gobject_class = G_OBJECT_CLASS(klass); gobject_class->constructor = maman_bar_constructor; } -static void -maman_bar_init (MamanBar *self) +static void maman_bar_init(MamanBar* self) { /* initialize the object */ } - -int -main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL); - g_object_unref(bar); - return 0; + MamanBar* bar = g_object_new(MAMAN_TYPE_BAR, NULL); + g_object_unref(bar); + return 0; } |