Remove g_type_init() calls

Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
This commit is contained in:
Ryan Lortie
2012-10-15 12:00:51 -04:00
parent 7c42ab23b5
commit 1dc774a653
136 changed files with 3 additions and 189 deletions

View File

@@ -32,8 +32,6 @@ main (int argc, char *argv[])
GError *error = NULL;
int i;
g_type_init ();
context = g_option_context_new(_("[FILE...]"));
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);

View File

@@ -262,7 +262,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
object = g_object_new (TEST_TYPE_OBJECT, NULL);

View File

@@ -181,7 +181,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
test_static_iface ();
test_dynamic_iface ();

View File

@@ -164,7 +164,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
test_dynamic_type ();

View File

@@ -388,7 +388,6 @@ int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_type_init ();
g_test_add_func ("/gvalue/enum-transformation", test_enum_transformation);
g_test_add_func ("/gvalue/gtype", test_gtype_value);

View File

@@ -118,8 +118,6 @@ main (int argc,
char *string1 = "A";
char *string2 = "B";
g_type_init ();
/* Basic check of interfaces added before class_init time
*/
g_type_add_interface_check (string1, check_func);

View File

@@ -189,7 +189,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
/* Register BaseObject */
BASE_TYPE_OBJECT;

View File

@@ -381,7 +381,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
/* We force the interfaces to be registered in a different order
* than we add them, so our logic doesn't always deal with interfaces

View File

@@ -400,7 +400,6 @@ main (int argc, char **argv)
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init();
test (TEST_TYPE_A, "foo", "TestA::foo,TestI::foo", NULL);
test (TEST_TYPE_A, "bar", "TestA::bar", NULL);

View File

@@ -256,7 +256,6 @@ int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_type_init ();
g_test_add_func ("/paramspec/char", test_param_spec_char);
g_test_add_func ("/paramspec/string", test_param_spec_string);

View File

@@ -340,8 +340,6 @@ main (int argc,
GError *error = NULL;
int i;
g_type_init ();
context = g_option_context_new ("GObject performance tests");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@@ -885,8 +885,6 @@ main (int argc,
GError *error = NULL;
int i;
g_type_init ();
context = g_option_context_new ("GObject performance tests");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@@ -168,7 +168,6 @@ main (int argc,
g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_CRITICAL);
g_type_init ();
/* Test basic weak reference operation
*/

View File

@@ -71,7 +71,7 @@ main (int argc,
char *argv[])
{
MySingleton *singleton, *obj;
g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS);
/* create the singleton */
singleton = g_object_new (MY_TYPE_SINGLETON, NULL);
g_assert (singleton != NULL);

View File

@@ -243,7 +243,6 @@ main (int argc,
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
object = g_object_new (G_TYPE_TEST, NULL);
closure = g_cclosure_new (G_CALLBACK (test_signal_handler), TEST_POINTER2, destroy_data);

View File

@@ -119,7 +119,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test1 = g_object_new (G_TYPE_TEST, NULL);
test2 = g_object_new (G_TYPE_TEST, NULL);

View File

@@ -103,7 +103,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test = g_object_new (G_TYPE_TEST, NULL);

View File

@@ -196,7 +196,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test_objects = g_array_new (FALSE, FALSE, sizeof (GTest *));

View File

@@ -180,8 +180,7 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test = g_object_new (G_TYPE_TEST, NULL);
g_signal_connect (test, "notify::dummy", G_CALLBACK (dummy_notify), NULL);

View File

@@ -161,7 +161,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test = g_object_new (G_TYPE_TEST, NULL);

View File

@@ -153,7 +153,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
badger1 = g_object_new (MY_TYPE_BADGER, NULL);
badger2 = g_object_new (MY_TYPE_BADGER, NULL);

View File

@@ -264,7 +264,6 @@ main (int argc, char **argv)
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
g_type_init ();
test1 = g_object_new (G_TYPE_TEST, NULL);
test2 = g_object_new (G_TYPE_TEST, NULL);

View File

@@ -187,8 +187,6 @@ main (int argc, char **argv)
struct rusage old_usage;
struct rusage new_usage;
g_type_init ();
if (argc > 1)
n_children = atoi(argv[1]);