From b84cf3f49d7b6ff47aace071129e9fec033b9a5e Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Fri, 15 Mar 2019 16:26:51 +0100 Subject: caja-property-browser: Fix cast from non-struct type to struct type Fixes Clang static analyzer warnings: caja-property-browser.c:1242:45: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption CajaPropertyBrowser *property_browser = CAJA_PROPERTY_BROWSER (data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ caja-property-browser.c:1414:45: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption CajaPropertyBrowser *property_browser = CAJA_PROPERTY_BROWSER (data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ caja-property-browser.c:1450:45: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption CajaPropertyBrowser *property_browser = CAJA_PROPERTY_BROWSER(data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/caja-property-browser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c index ec838769..03586246 100644 --- a/src/caja-property-browser.c +++ b/src/caja-property-browser.c @@ -1235,7 +1235,7 @@ caja_color_selection_dialog_new (CajaPropertyBrowser *property_browser) /* add the newly selected file to the browser images */ static void -add_pattern_to_browser (GtkDialog *dialog, gint response_id, gpointer *data) +add_pattern_to_browser (GtkDialog *dialog, gint response_id, gpointer data) { char *directory_path, *destination_name; char *basename; @@ -1408,7 +1408,7 @@ add_color_to_file (CajaPropertyBrowser *property_browser, const char *color_spec /* handle the OK button being pushed on the color selection dialog */ static void -add_color_to_browser (GtkWidget *widget, gint which_button, gpointer *data) +add_color_to_browser (GtkWidget *widget, gint which_button, gpointer data) { char * color_spec; const char *color_name; @@ -1447,10 +1447,10 @@ add_color_to_browser (GtkWidget *widget, gint which_button, gpointer *data) /* create the color selection dialog, pre-set with the color that was just selected */ static void -show_color_selection_window (GtkWidget *widget, gpointer *data) +show_color_selection_window (GtkWidget *widget, gpointer data) { GdkColor color; - CajaPropertyBrowser *property_browser = CAJA_PROPERTY_BROWSER(data); + CajaPropertyBrowser *property_browser = CAJA_PROPERTY_BROWSER (data); gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (property_browser->details->colors_dialog))), -- cgit v1.2.1