Commit 1dc774a6 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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
parent 7c42ab23
......@@ -959,8 +959,6 @@ g_application_id_is_valid (const gchar *application_id)
*
* Creates a new #GApplication instance.
*
* This function calls g_type_init() for you.
*
* If non-%NULL, the application id must be valid. See
* g_application_id_is_valid().
*
......@@ -975,8 +973,6 @@ g_application_new (const gchar *application_id,
{
g_return_val_if_fail (application_id == NULL || g_application_id_is_valid (application_id), NULL);
g_type_init ();
return g_object_new (G_TYPE_APPLICATION,
"application-id", application_id,
"flags", flags,
......
......@@ -1948,8 +1948,6 @@ main (gint argc, gchar *argv[])
completion_cur = NULL;
completion_prev = NULL;
g_type_init ();
if (argc < 2)
{
usage (&argc, &argv, FALSE);
......
......@@ -1333,8 +1333,6 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
if (g_getenv ("GDBUS_DAEMON_DEBUG") != NULL)
open_console_window ();
g_type_init ();
loop = g_main_loop_new (NULL, FALSE);
address = "nonce-tcp:";
......
......@@ -129,8 +129,6 @@ main (gint argc,
{
int i;
g_type_init ();
if (argc == 1)
{
g_print ("Usage: gio-querymodules <directory1> [<directory2> ...]\n");
......
......@@ -641,8 +641,6 @@ main (int argc, char **argv)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
g_type_init ();
context = g_option_context_new (N_("FILE"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
g_option_context_set_summary (context,
......
......@@ -602,8 +602,6 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
g_type_init ();
if (argc < 2)
return cmd_help (FALSE, NULL);
......
......@@ -772,8 +772,6 @@ main (int argc, char **argv)
else
return gsettings_help (FALSE, argv[1]);
g_type_init ();
if (argc > 2)
{
gchar **parts;
......
......@@ -833,7 +833,6 @@ test_bug679509 (void)
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/actions/basic", test_basic);
......
......@@ -379,7 +379,6 @@ test_from_keyfile (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/appinfo/basic", test_basic);
......
......@@ -247,8 +247,6 @@ main (int argc,
{
SetupData *data;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
......
......@@ -372,7 +372,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
......
......@@ -307,8 +307,6 @@ test_truncate(void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/buffered-output-stream/write", test_write);
......
......@@ -221,7 +221,6 @@ test_cancel_multiple_concurrent (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/cancellable/multiple-concurrent", test_cancel_multiple_concurrent);
......
......@@ -203,8 +203,6 @@ test_icon (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/contenttype/guess", test_guess);
......
......@@ -185,7 +185,6 @@ main (int argc, char **argv)
GError *error = NULL;
int ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_file_get_contents (TEST_FILE, &test_file_buffer,
......
......@@ -1172,7 +1172,6 @@ main (int argc,
gint i;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
......
......@@ -485,7 +485,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/data-input-stream/basic", test_basic);
......
......@@ -494,7 +494,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/data-output-stream/basic", test_basic);
......
......@@ -356,7 +356,6 @@ main (int argc,
{
gint result;
g_type_init ();
g_test_init (&argc, &argv, NULL);
basedir = g_get_current_dir ();
......
......@@ -42,8 +42,6 @@ main (int argc, char *argv[])
GOptionContext *context;
GError *error = NULL;
g_type_init ();
context = g_option_context_new (" - Test GSocket server stuff");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))
......
......@@ -653,8 +653,6 @@ test_async_delete (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/file/basic", test_basic);
......
......@@ -166,8 +166,6 @@ test_subtract (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/fileattributematcher/exact", test_exact);
......
......@@ -215,8 +215,6 @@ main (int argc, char *argv[])
GFile *file;
int i;
g_type_init ();
context =
g_option_context_new ("LOCATION... - concatenate LOCATIONS "
"to standard output.");
......
......@@ -249,7 +249,6 @@ main (int argc, char **argv)
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
g_type_init ();
g_test_add_func ("/filter-stream/input", test_input_filter);
g_test_add_func ("/filter-stream/output", test_output_filter);
#if 0
......
......@@ -118,7 +118,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/g-file-info/test_g_file_info", test_g_file_info);
......
......@@ -506,7 +506,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
......
......@@ -371,7 +371,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/icons/serialize", test_g_icon_serialize);
......
......@@ -82,8 +82,6 @@ test_application_new (const gchar *application_id,
{
g_return_val_if_fail (g_application_id_is_valid (application_id), NULL);
g_type_init ();
return g_object_new (test_application_get_type (),
"application-id", application_id,
"flags", flags,
......
......@@ -73,8 +73,6 @@ test_application_new (const gchar *application_id,
{
g_return_val_if_fail (g_application_id_is_valid (application_id), NULL);
g_type_init ();
return g_object_new (test_application_get_type (),
"application-id", application_id,
"flags", flags,
......
......@@ -451,8 +451,6 @@ test_actions (void)
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();
......
......@@ -106,7 +106,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gdbus/empty-address", test_empty_address);
......
......@@ -266,7 +266,6 @@ main (int argc,
setlocale (LC_ALL, "C");
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();
......
......@@ -80,7 +80,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();
......
......@@ -384,7 +384,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/gdbus/close-pending", Fixture, "close",
......
......@@ -30,8 +30,6 @@ main (int argc,
GError *error;
gboolean ret;
g_type_init ();
error = NULL;
c = g_bus_get_sync (G_BUS_TYPE_SESSION,
NULL, /* GCancellable* */
......
......@@ -370,7 +370,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/gdbus/connection/flush/busy", Fixture, NULL,
......
......@@ -113,7 +113,6 @@ main (int argc,
GError *error;
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -194,7 +194,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -1142,7 +1142,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -22,8 +22,6 @@ main (int argc, char *argv[])
{ NULL }
};
g_type_init ();
context = g_option_context_new ("");
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
g_option_context_set_summary (context,
......
......@@ -257,7 +257,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gdbus/registered-errors", test_registered_errors);
......
......@@ -303,8 +303,6 @@ main (int argc, char *argv[])
GMainLoop *loop;
MyObject *myobj;
g_type_init ();
/* We are lazy here - we don't want to manually provide
* the introspection data structures - so we just build
* them from XML.
......
......@@ -117,8 +117,6 @@ main (gint argc, gchar *argv[])
manager = NULL;
loop = NULL;
g_type_init ();
loop = g_main_loop_new (NULL, FALSE);
error = NULL;
......
......@@ -139,8 +139,6 @@ main (gint argc, gchar *argv[])
GMainLoop *loop;
guint id;
g_type_init ();
loop = g_main_loop_new (NULL, FALSE);
id = g_bus_own_name (G_BUS_TYPE_SESSION,
......
......@@ -43,8 +43,6 @@ main (int argc, char *argv[])
{ NULL}
};
g_type_init ();
error = NULL;
opt_name = NULL;
opt_replace = FALSE;
......
......@@ -177,8 +177,6 @@ main (int argc, char *argv[])
ret = 1;
g_type_init ();
opt_address = NULL;
opt_server = FALSE;
opt_allow_anonymous = FALSE;
......
......@@ -363,8 +363,6 @@ main (int argc, char *argv[])
guint owner_id;
GMainLoop *loop;
g_type_init ();
/* We are lazy here - we don't want to manually provide
* the introspection data structures - so we just build
* them from XML.
......
......@@ -364,8 +364,6 @@ main (int argc, char *argv[])
guint owner_id;
GMainLoop *loop;
g_type_init ();
/* We are lazy here - we don't want to manually provide
* the introspection data structures - so we just build
* them from XML.
......
......@@ -116,8 +116,6 @@ main (int argc, char *argv[])
guint watcher_id;
GMainLoop *loop;
g_type_init ();
watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gtk.GDBus.TestServer",
G_BUS_NAME_WATCHER_FLAGS_NONE,
......
......@@ -43,8 +43,6 @@ main (int argc, char *argv[])
GError *error;
GBusNameWatcherFlags flags;
g_type_init ();
error = NULL;
opt_context = g_option_context_new ("g_bus_watch_name() example");
g_option_context_set_summary (opt_context,
......
......@@ -153,8 +153,6 @@ main (int argc, char *argv[])
GDBusProxyFlags flags;
GDBusProxy *proxy;
g_type_init ();
loop = NULL;
proxy = NULL;
......
......@@ -203,7 +203,6 @@ main (int argc,
{
gint i;
g_type_init ();
g_test_init (&argc, &argv, NULL);
for (i = 0; cases[i].name != NULL; i++)
......
......@@ -1531,7 +1531,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -303,7 +303,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -149,7 +149,6 @@ main (int argc,
{
setlocale (LC_ALL, "C");
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gdbus/message/lock", message_lock);
......
......@@ -769,7 +769,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
loop = g_main_loop_new (NULL, FALSE);
......
......@@ -291,7 +291,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gdbus/non-socket", test_non_socket);
......
......@@ -1801,7 +1801,6 @@ main (int argc,
GDBusNodeInfo *introspection_data = NULL;
gchar *tmpdir = NULL;
g_type_init ();
g_test_init (&argc, &argv, NULL);
introspection_data = g_dbus_node_info_new_for_xml (test_interface_introspection_xml, NULL);
......
......@@ -239,7 +239,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();
......
......@@ -259,7 +259,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
......
......@@ -912,7 +912,6 @@ main (int argc,
gint ret;
GDBusNodeInfo *introspection_data = NULL;
g_type_init ();
g_test_init (&argc, &argv, NULL);
introspection_data = g_dbus_node_info_new_for_xml (frob_dbus_interface_xml, NULL);
......
......@@ -1056,7 +1056,6 @@ main (int argc,
{
setlocale (LC_ALL, "C");
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=");
......
......@@ -2354,7 +2354,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();
......
......@@ -582,7 +582,6 @@ main (int argc,
GError *error;
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();
......
<
......@@ -1141,7 +1141,6 @@ main (int argc, char **argv)
gboolean ret;
g_test_init (&argc, &argv, NULL);
g_type_init ();
session_bus_up ();