From 448230b381a6ba0394962ca73f35af563b5de4c9 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 16 Oct 2012 10:58:08 -0400 Subject: Drop calls to g_type_init() And bump our GLib requirement. --- examples/glib-print.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples/glib-print.c') diff --git a/examples/glib-print.c b/examples/glib-print.c index f187f76c..606a29f3 100644 --- a/examples/glib-print.c +++ b/examples/glib-print.c @@ -8,8 +8,6 @@ int main(void) GIArgument in_args[5]; GIArgument retval; - g_type_init(); - repository = g_irepository_get_default(); g_irepository_require(repository, "GLib", "2.0", 0, &error); if (error) { -- cgit v1.2.1 From a701d2737277cd6cd8084e105db9922f14ec5fe5 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 27 Feb 2013 15:15:35 +0100 Subject: Reformat code to GNU style This was achieved by running "indent -gnu -i2 -nut -l120" over C files which use a different style, and manually fixing pointer declarations and modelines. --- examples/glib-print.c | 60 +++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'examples/glib-print.c') diff --git a/examples/glib-print.c b/examples/glib-print.c index 606a29f3..4e117d9d 100644 --- a/examples/glib-print.c +++ b/examples/glib-print.c @@ -1,44 +1,48 @@ #include -int main(void) +int +main (void) { - GIRepository *repository; - GError *error = NULL; - GIBaseInfo *base_info; - GIArgument in_args[5]; - GIArgument retval; + GIRepository *repository; + GError *error = NULL; + GIBaseInfo *base_info; + GIArgument in_args[5]; + GIArgument retval; - repository = g_irepository_get_default(); - g_irepository_require(repository, "GLib", "2.0", 0, &error); - if (error) { - g_error("ERROR: %s\n", error->message); + repository = g_irepository_get_default (); + g_irepository_require (repository, "GLib", "2.0", 0, &error); + if (error) + { + g_error ("ERROR: %s\n", error->message); return 1; } - base_info = g_irepository_find_by_name(repository, "GLib", "assertion_message"); - if (!base_info) { - g_error("ERROR: %s\n", "Could not find GLib.warn_message"); + base_info = g_irepository_find_by_name (repository, "GLib", "assertion_message"); + if (!base_info) + { + g_error ("ERROR: %s\n", "Could not find GLib.warn_message"); return 1; } - in_args[0].v_pointer = "domain"; - in_args[1].v_pointer = "glib-print.c"; - in_args[2].v_pointer = "30"; - in_args[3].v_pointer = "main"; - in_args[4].v_pointer = "hello world"; + in_args[0].v_pointer = "domain"; + in_args[1].v_pointer = "glib-print.c"; + in_args[2].v_pointer = "30"; + in_args[3].v_pointer = "main"; + in_args[4].v_pointer = "hello world"; - if (!g_function_info_invoke ((GIFunctionInfo *)base_info, - (const GIArgument*)&in_args, - 5, - NULL, - 0, - &retval, - &error)) { - g_error("ERROR: %s\n", error->message); + if (!g_function_info_invoke ((GIFunctionInfo *) base_info, + (const GIArgument *) &in_args, + 5, + NULL, + 0, + &retval, + &error)) + { + g_error ("ERROR: %s\n", error->message); return 1; } - g_base_info_unref (base_info); + g_base_info_unref (base_info); - return 0; + return 0; } -- cgit v1.2.1