Commit a4f1c2a5 authored by Colin Walters's avatar Colin Walters

Use G_GNUC_BEGIN_IGNORE_DEPRECATIONS to avoid warning spam

In these cases, we can't every drop use of our API which we deprecated
for external callers; for example where a (deprecated) command line is
invoking the deprecated API.

This patch avoids having polkit developers get spammed by unfixable
warnings.
parent 6d3d0a8f
......@@ -247,11 +247,15 @@ polkit_subject_from_string (const gchar *str,
}
else if (sscanf (str, "unix-process:%d:%" G_GUINT64_FORMAT, &scanned_pid, &scanned_starttime) == 2)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new_full (scanned_pid, scanned_starttime);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (sscanf (str, "unix-process:%d", &scanned_pid) == 1)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new (scanned_pid);
G_GNUC_END_IGNORE_DEPRECATIONS
if (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject)) == 0)
{
g_object_unref (subject);
......
......@@ -399,11 +399,15 @@ main (int argc, char *argv[])
}
else if (sscanf (argv[n], "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time) == 2)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new_full (pid, pid_start_time);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (sscanf (argv[n], "%i", &pid) == 1)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new (pid);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
......
......@@ -111,9 +111,17 @@ main (int argc, char *argv[])
if (sscanf (opt_process, "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time)
== 2)
subject = polkit_unix_process_new_full (pid, pid_start_time);
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new_full (pid, pid_start_time);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (sscanf (opt_process, "%i", &pid) == 1)
subject = polkit_unix_process_new (pid);
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
subject = polkit_unix_process_new (pid);
G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
g_printerr (_("%s: Invalid process specifier `%s'\n"),
......
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