summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-15 11:40:34 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-16 14:38:14 +0200
commit2beb5d4fc7d18e63a633b7a3a5ccfda9c2746d3f (patch)
tree4758c631a67dd56394bd23c1f15484e9eec907be /src
parent876e72b42595f60fcc134ed5c9e9d36a9ad2b938 (diff)
downloadmate-screensaver-2beb5d4fc7d18e63a633b7a3a5ccfda9c2746d3f.tar.bz2
mate-screensaver-2beb5d4fc7d18e63a633b7a3a5ccfda9c2746d3f.tar.xz
Remove function casting for g_idle_add (function, data)
Diffstat (limited to 'src')
-rw-r--r--src/gs-auth-pam.c5
-rw-r--r--src/gs-manager.c6
-rw-r--r--src/gs-window-x11.c10
-rw-r--r--src/mate-screensaver-command.c5
-rw-r--r--src/mate-screensaver-dialog.c20
-rw-r--r--src/mate-screensaver-preferences.c3
6 files changed, 29 insertions, 20 deletions
diff --git a/src/gs-auth-pam.c b/src/gs-auth-pam.c
index ae9cea0..a4961b9 100644
--- a/src/gs-auth-pam.c
+++ b/src/gs-auth-pam.c
@@ -185,8 +185,9 @@ auth_message_handler (GSAuthMessageStyle style,
}
static gboolean
-gs_auth_queued_message_handler (GsAuthMessageHandlerData *data)
+gs_auth_queued_message_handler (gpointer user_data)
{
+ GsAuthMessageHandlerData *data = user_data;
gboolean res;
if (gs_auth_get_verbose ())
@@ -237,7 +238,7 @@ gs_auth_run_message_handler (struct pam_closure *c,
/* Queue the callback in the gui (the main) thread
*/
- g_idle_add ((GSourceFunc) gs_auth_queued_message_handler, &data);
+ g_idle_add (gs_auth_queued_message_handler, &data);
if (gs_auth_get_verbose ())
{
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 139a305..f1490d9 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -1076,8 +1076,10 @@ remove_unfade_idle (GSManager *manager)
static gboolean
-window_deactivated_idle (GSManager *manager)
+window_deactivated_idle (gpointer data)
{
+ GSManager *manager = data;
+
g_return_val_if_fail (manager != NULL, FALSE);
g_return_val_if_fail (GS_IS_MANAGER (manager), FALSE);
@@ -1095,7 +1097,7 @@ window_deactivated_cb (GSWindow *window,
g_return_if_fail (manager != NULL);
g_return_if_fail (GS_IS_MANAGER (manager));
- g_idle_add ((GSourceFunc)window_deactivated_idle, manager);
+ g_idle_add (window_deactivated_idle, manager);
}
static GSWindow *
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index c1c9fc8..b8df256 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -43,7 +43,7 @@
static void gs_window_finalize (GObject *object);
-static gboolean popup_dialog_idle (GSWindow *window);
+static gboolean popup_dialog_idle (gpointer data);
static void gs_window_dialog_finish (GSWindow *window);
static void remove_command_watches (GSWindow *window);
@@ -636,7 +636,7 @@ remove_popup_dialog_idle (GSWindow *window)
static void
add_popup_dialog_idle (GSWindow *window)
{
- window->priv->popup_dialog_idle_id = g_idle_add ((GSourceFunc)popup_dialog_idle, window);
+ window->priv->popup_dialog_idle_id = g_idle_add (popup_dialog_idle, window);
}
static gboolean
@@ -1753,12 +1753,12 @@ popup_dialog (GSWindow *window)
}
static gboolean
-popup_dialog_idle (GSWindow *window)
+popup_dialog_idle (gpointer data)
{
- popup_dialog (window);
+ GSWindow *window = data;
+ popup_dialog (window);
window->priv->popup_dialog_idle_id = 0;
-
return FALSE;
}
diff --git a/src/mate-screensaver-command.c b/src/mate-screensaver-command.c
index 60c6001..77cfd27 100644
--- a/src/mate-screensaver-command.c
+++ b/src/mate-screensaver-command.c
@@ -329,8 +329,9 @@ oom:
}
static gboolean
-do_command (DBusConnection *connection)
+do_command (gpointer data)
{
+ DBusConnection *connection = data;
DBusMessage *reply;
if (do_quit)
@@ -545,7 +546,7 @@ main (int argc,
exit (1);
}
- g_idle_add ((GSourceFunc)do_command, connection);
+ g_idle_add (do_command, connection);
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
diff --git a/src/mate-screensaver-dialog.c b/src/mate-screensaver-dialog.c
index 2074a13..06ea62a 100644
--- a/src/mate-screensaver-dialog.c
+++ b/src/mate-screensaver-dialog.c
@@ -104,8 +104,9 @@ static void response_ok(void)
fflush(stdout);
}
-static gboolean quit_response_ok(void)
+static gboolean quit_response_ok(gpointer data)
{
+ (void)data; /* remove warning unused parameter ‘data’ */
response_ok();
gtk_main_quit();
return FALSE;
@@ -320,8 +321,9 @@ static void response_cb(GSLockPlug* plug, gint response_id)
}
}
-static gboolean response_request_quit(void)
+static gboolean response_request_quit(gpointer data)
{
+ (void)data; /* remove warning unused parameter ‘data’ */
printf("REQUEST QUIT\n");
fflush(stdout);
return FALSE;
@@ -333,8 +335,9 @@ static gboolean quit_timeout_cb(gpointer data)
return FALSE;
}
-static gboolean auth_check_idle(GSLockPlug* plug)
+static gboolean auth_check_idle(gpointer data)
{
+ GSLockPlug* plug = data;
gboolean res;
gboolean again;
static guint loop_counter = 0;
@@ -345,7 +348,7 @@ static gboolean auth_check_idle(GSLockPlug* plug)
if (res)
{
again = FALSE;
- g_idle_add (G_SOURCE_FUNC (quit_response_ok), NULL);
+ g_idle_add (quit_response_ok, NULL);
}
else
{
@@ -363,7 +366,7 @@ static gboolean auth_check_idle(GSLockPlug* plug)
/* Don't quit immediately, but rather request that mate-screensaver
* terminates us after it has finished the dialog shake. Time out
* after 5 seconds and quit anyway if this doesn't happen though */
- g_idle_add (G_SOURCE_FUNC (response_request_quit), NULL);
+ g_idle_add (response_request_quit, NULL);
g_timeout_add(5000, (GSourceFunc) quit_timeout_cb, NULL);
}
}
@@ -376,10 +379,11 @@ static void show_cb(GtkWidget* widget, gpointer data)
print_id(widget);
}
-static gboolean popup_dialog_idle(void)
+static gboolean popup_dialog_idle(gpointer data)
{
GtkWidget* widget;
+ (void)data; /* remove warning unused parameter ‘data’ */
gs_profile_start(NULL);
widget = gs_lock_plug_new();
@@ -409,7 +413,7 @@ static gboolean popup_dialog_idle(void)
gtk_widget_realize(widget);
- g_idle_add((GSourceFunc) auth_check_idle, widget);
+ g_idle_add(auth_check_idle, widget);
gs_profile_end(NULL);
@@ -595,7 +599,7 @@ int main(int argc, char** argv)
gs_debug_init(verbose, FALSE);
- g_idle_add (G_SOURCE_FUNC (popup_dialog_idle), NULL);
+ g_idle_add (popup_dialog_idle, NULL);
gtk_main();
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index 8efb25a..9d1706a 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -1492,6 +1492,7 @@ widget_set_best_visual (GtkWidget *widget)
static gboolean
setup_treeview_idle (gpointer data)
{
+ (void)data; /* remove warning unused parameter ‘data’ */
GtkWidget *preview;
GtkWidget *treeview;
@@ -1709,7 +1710,7 @@ init_capplet (void)
g_signal_connect (fullscreen_preview_next, "clicked",
G_CALLBACK (fullscreen_preview_next_cb), NULL);
- g_idle_add ((GSourceFunc)setup_treeview_idle, NULL);
+ g_idle_add (setup_treeview_idle, NULL);
}
static void