Commit 7ddfd621 authored by Miloslav Trmač's avatar Miloslav Trmač Committed by Ray Strode

Move to current GLib

Set up glib to use the installed version for deprecation warnings
instead of limiting ourselves to [2.30,2.34]; this will let us use
newer API, and help us keep up to date with future deprecations.

Then fix all the warnings (as of GLib 2.44.1).

https://bugs.freedesktop.org/show_bug.cgi?id=91198
parent 4d3ad674
......@@ -77,10 +77,6 @@ AC_SUBST(WARN_CFLAGS)
PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_30],
[Avoid warning spew about g_type_init() being deprecated])
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,34)],
[Notify us when we'll need to transition away from g_type_init()])
PKG_CHECK_MODULES(LIBJS, [mozjs-24])
......
......@@ -102,8 +102,6 @@ main (int argc, char *argv[])
PolkitAuthority *authority;
GCancellable *cancellable;
g_type_init ();
if (argc != 2)
{
g_printerr ("usage: %s <action_id>\n", argv[0]);
......
......@@ -88,8 +88,6 @@ send_dbus_message (const char *cookie, const char *user)
ret = FALSE;
g_type_init ();
error = NULL;
authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
if (authority == NULL)
......
......@@ -422,10 +422,8 @@ polkit_agent_listener_register_with_options (PolkitAgentListener *listener,
if (flags & POLKIT_AGENT_REGISTER_FLAGS_RUN_IN_THREAD)
{
server->thread = g_thread_create (server_thread_func,
server,
TRUE,
error);
server->thread = g_thread_try_new ("polkit agent listener",
server_thread_func, server, error);
if (server->thread == NULL)
{
server_free (server);
......
......@@ -173,8 +173,6 @@ main (int argc,
/* Disable remote file access from GIO. */
setenv ("GIO_USE_VFS", "local", 1);
g_type_init ();
opt_context = g_option_context_new ("polkit system daemon");
g_option_context_add_main_entries (opt_context, opt_entries, NULL);
error = NULL;
......
......@@ -125,8 +125,6 @@ main (int argc, char *argv[])
/* Disable remote file access from GIO. */
setenv ("GIO_USE_VFS", "local", 1);
g_type_init ();
opt_show_version = FALSE;
opt_verbose = FALSE;
......
......@@ -366,8 +366,6 @@ main (int argc, char *argv[])
/* Disable remote file access from GIO. */
setenv ("GIO_USE_VFS", "local", 1);
g_type_init ();
details = polkit_details_new ();
opt_show_help = FALSE;
......
......@@ -707,11 +707,6 @@ main (int argc, char *argv[])
goto out;
}
/* Initialize the GLib type system - this is needed to interact with the
* PolicyKit daemon
*/
g_type_init ();
/* make sure we are nuked if the parent process dies */
#ifdef __linux__
if (prctl (PR_SET_PDEATHSIG, SIGTERM) != 0)
......
......@@ -78,8 +78,6 @@ main (int argc, char *argv[])
/* Disable remote file access from GIO. */
setenv ("GIO_USE_VFS", "local", 1);
g_type_init ();
error = NULL;
context = g_option_context_new ("");
s = g_strdup_printf (_("Report bugs to: %s\n"
......
......@@ -170,7 +170,6 @@ add_comparison_tests (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_data_func ("/PolkitIdentity/user_string_0", "unix-user:root", test_string);
......
......@@ -73,7 +73,6 @@ test_set_gid (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/PolkitUnixGroup/new", test_new);
g_test_add_func ("/PolkitUnixGroup/new_for_name", test_new_for_name);
......
......@@ -68,7 +68,6 @@ test_set_name (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/PolkitUnixNetgroup/new", test_new);
g_test_add_func ("/PolkitUnixNetgroup/set_name", test_set_name);
......
......@@ -95,7 +95,6 @@ test_set_uid (void)
int
main (int argc, char *argv[])
{
g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/PolkitUnixUser/new", test_new);
g_test_add_func ("/PolkitUnixUser/new_for_name", test_new_for_name);
......
......@@ -403,7 +403,6 @@ main (int argc, char *argv[])
{
setlocale (LC_ALL, "");
g_type_init ();
g_test_init (&argc, &argv, NULL);
//polkit_test_redirect_logs ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment