summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-27 22:38:43 +0100
committerraveit65 <[email protected]>2020-03-13 16:43:30 +0100
commit242b68ceddb217a42547d578898be841dca2f4a3 (patch)
tree6e661efc8f713cf00400e7526b4c20c3659c2c81 /src
parentec8db2297fc1d435d26de2006b429b1e6ffdc8a3 (diff)
downloadmate-screensaver-242b68ceddb217a42547d578898be841dca2f4a3.tar.bz2
mate-screensaver-242b68ceddb217a42547d578898be841dca2f4a3.tar.xz
Remove warnings: cast between incompatible function types
Diffstat (limited to 'src')
-rw-r--r--src/copy-theme-dialog.c6
-rw-r--r--src/gs-auth-pam.c11
-rw-r--r--src/gs-lock-plug.c2
-rw-r--r--src/gs-manager.c3
-rw-r--r--src/gs-prefs.c6
-rw-r--r--src/mate-screensaver-dialog.c6
-rw-r--r--src/mate-screensaver-preferences.c3
7 files changed, 17 insertions, 20 deletions
diff --git a/src/copy-theme-dialog.c b/src/copy-theme-dialog.c
index 816d789..a4aaff5 100644
--- a/src/copy-theme-dialog.c
+++ b/src/copy-theme-dialog.c
@@ -434,10 +434,8 @@ copy_theme_dialog_finalize (GObject *obj)
CopyThemeDialog *dlg = COPY_THEME_DIALOG (obj);
g_object_unref (dlg->priv->theme_dir);
- g_slist_foreach (dlg->priv->all_files, (GFunc) (g_object_unref), NULL);
- g_slist_free (dlg->priv->all_files);
- g_slist_foreach (dlg->priv->all_basenames, (GFunc) (g_free), NULL);
- g_slist_free (dlg->priv->all_basenames);
+ g_slist_free_full (dlg->priv->all_files, g_object_unref);
+ g_slist_free_full (dlg->priv->all_basenames, g_free);
g_object_unref (dlg->priv->cancellable);
if (parent_class->finalize)
diff --git a/src/gs-auth-pam.c b/src/gs-auth-pam.c
index 3ca3e42..ae9cea0 100644
--- a/src/gs-auth-pam.c
+++ b/src/gs-auth-pam.c
@@ -509,9 +509,10 @@ set_pam_error (GError **error,
}
-static int
-gs_auth_thread_func (int auth_operation_fd)
+static gpointer
+gs_auth_thread_func (gpointer data)
{
+ int auth_operation_fd;
static const int flags = 0;
int status;
int status2;
@@ -519,6 +520,8 @@ gs_auth_thread_func (int auth_operation_fd)
sigset_t set;
const void *p;
+ auth_operation_fd = GPOINTER_TO_INT (data);
+
timeout.tv_sec = 0;
timeout.tv_nsec = 1;
@@ -602,7 +605,7 @@ done:
*/
close (auth_operation_fd);
- return status;
+ return GINT_TO_POINTER (status);
}
static gboolean
@@ -664,7 +667,7 @@ gs_auth_pam_verify_user (pam_handle_t *handle,
(GIOFunc) gs_auth_loop_quit, &thread_done);
auth_thread = g_thread_new ("auththread",
- (GThreadFunc) gs_auth_thread_func,
+ gs_auth_thread_func,
GINT_TO_POINTER (auth_operation_fds[1]));
if (auth_thread == NULL)
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index fddce2a..cb27964 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -2141,7 +2141,7 @@ gs_lock_plug_init (GSLockPlug *plug)
date_time_update (plug);
gtk_widget_show_all (plug->priv->vbox);
}
- plug->priv->datetime_timeout_id = g_timeout_add_seconds (1, (GSourceFunc) date_time_update, plug);
+ plug->priv->datetime_timeout_id = g_timeout_add_seconds (1, G_SOURCE_FUNC (date_time_update), plug);
if (plug->priv->note_text_view != NULL)
{
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 00ec982..cca90d8 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -387,8 +387,7 @@ free_themes (GSManager *manager)
{
if (manager->priv->themes)
{
- g_slist_foreach (manager->priv->themes, (GFunc)g_free, NULL);
- g_slist_free (manager->priv->themes);
+ g_slist_free_full (manager->priv->themes, g_free);
}
}
diff --git a/src/gs-prefs.c b/src/gs-prefs.c
index 5a0746b..3c3c074 100644
--- a/src/gs-prefs.c
+++ b/src/gs-prefs.c
@@ -202,8 +202,7 @@ _gs_prefs_set_themes (GSPrefs *prefs,
guint i;
if (prefs->themes)
{
- g_slist_foreach (prefs->themes, (GFunc)g_free, NULL);
- g_slist_free (prefs->themes);
+ g_slist_free_full (prefs->themes, g_free);
}
/* take ownership of the list */
@@ -600,8 +599,7 @@ gs_prefs_finalize (GObject *object)
if (prefs->themes)
{
- g_slist_foreach (prefs->themes, (GFunc)g_free, NULL);
- g_slist_free (prefs->themes);
+ g_slist_free_full (prefs->themes, g_free);
}
g_free (prefs->logout_command);
diff --git a/src/mate-screensaver-dialog.c b/src/mate-screensaver-dialog.c
index 62daa98..2074a13 100644
--- a/src/mate-screensaver-dialog.c
+++ b/src/mate-screensaver-dialog.c
@@ -345,7 +345,7 @@ static gboolean auth_check_idle(GSLockPlug* plug)
if (res)
{
again = FALSE;
- g_idle_add((GSourceFunc) quit_response_ok, NULL);
+ g_idle_add (G_SOURCE_FUNC (quit_response_ok), NULL);
}
else
{
@@ -363,7 +363,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((GSourceFunc) response_request_quit, NULL);
+ g_idle_add (G_SOURCE_FUNC (response_request_quit), NULL);
g_timeout_add(5000, (GSourceFunc) quit_timeout_cb, NULL);
}
}
@@ -595,7 +595,7 @@ int main(int argc, char** argv)
gs_debug_init(verbose, FALSE);
- g_idle_add((GSourceFunc) popup_dialog_idle, NULL);
+ g_idle_add (G_SOURCE_FUNC (popup_dialog_idle), NULL);
gtk_main();
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index 844be50..4ead5ed 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -807,8 +807,7 @@ theme_installer_run (GtkWidget *prefs_dialog, GList *files)
GtkWidget *copy_dialog;
copy_dialog = copy_theme_dialog_new (files);
- g_list_foreach (files, (GFunc) (g_object_unref), NULL);
- g_list_free (files);
+ g_list_free_full (files, g_object_unref);
gtk_window_set_transient_for (GTK_WINDOW (copy_dialog),
GTK_WINDOW (prefs_dialog));