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

@ -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,

View File

@ -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);

View File

@ -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:";

View File

@ -129,8 +129,6 @@ main (gint argc,
{
int i;
g_type_init ();
if (argc == 1)
{
g_print ("Usage: gio-querymodules <directory1> [<directory2> ...]\n");

View File

@ -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,

View File

@ -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);

View File

@ -772,8 +772,6 @@ main (int argc, char **argv)
else
return gsettings_help (FALSE, argv[1]);
g_type_init ();
if (argc > 2)
{
gchar **parts;

View File

@ -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);

View File

@ -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);

View File

@ -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/");

View File

@ -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/");

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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/");

View File

@ -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);

View File

@ -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);

View File

@ -356,7 +356,6 @@ main (int argc,
{
gint result;
g_type_init ();
g_test_init (&argc, &argv, NULL);
basedir = g_get_current_dir ();

View File

@ -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))

View File

@ -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);

View File

@ -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);

View File

@ -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.");

View File

@ -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

View File

@ -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);

View File

@ -506,7 +506,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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 ();

View File

@ -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);

View File

@ -266,7 +266,6 @@ main (int argc,
setlocale (LC_ALL, "C");
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();

View File

@ -80,7 +80,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();

View File

@ -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",

View File

@ -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* */

View File

@ -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,

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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,

View File

@ -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);

View File

@ -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.

View File

@ -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;

View File

@ -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,

View File

@ -43,8 +43,6 @@ main (int argc, char *argv[])
{ NULL}
};
g_type_init ();
error = NULL;
opt_name = NULL;
opt_replace = FALSE;

View File

@ -177,8 +177,6 @@ main (int argc, char *argv[])
ret = 1;
g_type_init ();
opt_address = NULL;
opt_server = FALSE;
opt_allow_anonymous = FALSE;

View File

@ -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.

View File

@ -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.

View File

@ -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,

View File

@ -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,

View File

@ -153,8 +153,6 @@ main (int argc, char *argv[])
GDBusProxyFlags flags;
GDBusProxy *proxy;
g_type_init ();
loop = NULL;
proxy = NULL;

View File

@ -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++)

View File

@ -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 */

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -239,7 +239,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_dbus_unset ();

View File

@ -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 */

View File

@ -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);

View File

@ -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=");

View File

@ -2354,7 +2354,6 @@ main (int argc,
{
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();

View File

@ -582,7 +582,6 @@ main (int argc,
GError *error;
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
session_bus_up ();

View File

@ -1141,7 +1141,6 @@ main (int argc, char **argv)
gboolean ret;
g_test_init (&argc, &argv, NULL);
g_type_init ();
session_bus_up ();

View File

@ -131,7 +131,6 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
g_type_init ();
g_test_init (&argc, &argv, NULL);
for (i = 0; i < G_N_ELEMENTS (tests); ++i)

View File

@ -2141,7 +2141,6 @@ main (int argc, char *argv[])
if (!backend_set)
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_remove ("org.gtk.test.enums.xml");

View File

@ -146,8 +146,6 @@ main (int argc, char *argv[])
GOptionContext *context;
GError *error = NULL;
g_type_init ();
context = g_option_context_new ("<http root dir> - Simple HTTP server");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@ -347,7 +347,6 @@ test_mask_match (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/inet-address/parse", test_parse);

View File

@ -177,7 +177,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/io-stream/copy-chunks", test_copy_chunks);

View File

@ -1236,7 +1236,6 @@ main (int argc, char *argv[])
posix_compat = FALSE;
/* strip all gtester-specific args */
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* no extra parameters specified, assume we're executed from glib test suite */

View File

@ -226,7 +226,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/memory-input-stream/read-chunks", test_read_chunks);

View File

@ -216,7 +216,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");

View File

@ -580,7 +580,6 @@ test_scheme_handler (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
setup ();

View File

@ -111,8 +111,6 @@ main (int argc, char *argv[])
gint i;
gchar *path;
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/network-address/basic", test_basic);

View File

@ -514,8 +514,6 @@ main (int argc, char **argv)
{
int ret;
g_type_init ();
if (argc == 2 && !strcmp (argv[1], "--watch"))
{
do_watch_network ();

View File

@ -109,7 +109,6 @@ test_simple (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/permission/simple", test_simple);

View File

@ -274,7 +274,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
#ifdef G_OS_UNIX

View File

@ -1096,7 +1096,6 @@ main (int argc,
GCancellable *cancellable;
gint result;
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* Register stuff. The dummy g_proxy_get_default_for_protocol() call

View File

@ -580,8 +580,6 @@ main (gint argc, gchar **argv)
gboolean cancel = FALSE;
ProxyTestType type = USE_RESOLVER;
g_type_init ();
while (argc >= 2 && argv[1][0] == '-')
{
if (!strcmp (argv[1], "-s"))

View File

@ -284,7 +284,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/readwrite/test_g_file_open_readwrite",

View File

@ -684,8 +684,6 @@ main (int argc, char **argv)
guint watch;
#endif
g_type_init ();
context = g_option_context_new ("lookups ...");
g_option_context_add_main_entries (context, option_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@ -630,7 +630,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
_g_test2_register_resource ();

View File

@ -90,8 +90,6 @@ main (int argc, char *argv[])
GError *error = NULL;
char buffer[1000];
g_type_init ();
context = g_option_context_new (" <hostname>[:port] - send data to tcp host");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@ -122,7 +122,6 @@ test_simple_async (void)
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gio/simple-async-result/test", test_simple_async);

View File

@ -285,7 +285,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);
g_test_add_func ("/filter-stream/async", asynch);

View File

@ -261,8 +261,6 @@ main (int argc,
GTlsCertificate *certificate = NULL;
gint i;
g_type_init ();
address = NULL;
connection = NULL;

View File

@ -63,8 +63,6 @@ main (int argc,
GInputStream *istream;
GOutputStream *ostream;
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))

View File

@ -817,7 +817,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/socket/ipv4_sync", test_ipv4_sync);

View File

@ -149,7 +149,6 @@ test_srv_target_ordering (void)
int
main (int argc, char **argv)
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/srvtarget/srv-target-ordering", test_srv_target_ordering);

View File

@ -1632,7 +1632,6 @@ main (int argc, char **argv)
{
int ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
loop = g_main_loop_new (NULL, FALSE);

View File

@ -269,7 +269,6 @@ main (int argc,
Reference ref;
GError *error = NULL;
g_type_init ();
g_test_init (&argc, &argv, NULL);
_g_test_tls_backend_get_type ();

View File

@ -606,7 +606,6 @@ main (int argc,
GPtrArray *fixtures;
gint ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
fixtures = g_ptr_array_new_with_free_func (g_free);

View File

@ -235,8 +235,6 @@ main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
g_type_init ();
g_test_add_func ("/unix-streams/file-descriptors", test_fds);
return g_test_run();

View File

@ -299,7 +299,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/unix-streams/basic", test_basic);

View File

@ -46,7 +46,6 @@ test_local (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gvfs/local", test_local);

View File

@ -164,8 +164,6 @@ main (int argc, char *argv[])
g_setenv ("GIO_USE_VFS", "local", FALSE);
g_type_init ();
g_test_init (&argc, &argv, NULL);
monitor = g_volume_monitor_get ();

View File

@ -525,7 +525,6 @@ int
main (int argc,
char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/win32-streams/pipe-io-test", test_pipe_io);

View File

@ -135,8 +135,6 @@ main (gint argc,
root = G_TYPE_OBJECT;
g_type_init ();
for (i = 1; i < argc; i++)
{
if (strcmp ("-s", argv[i]) == 0)

View File

@ -79,8 +79,6 @@
* GValue b = G_VALUE_INIT;
* const gchar *message;
*
* g_type_init ();
*
* /&ast; The GValue starts empty &ast;/
* g_assert (!G_VALUE_HOLDS_STRING (&amp;a));
*

Some files were not shown because too many files have changed in this diff Show More