[evolution/gnome-40] Ensure non-const pointers passed to I_CAL_IS_... functions



commit a830c237c9072f6cdd7aefa62e1a4e0f67d4a50c
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 7 11:40:53 2021 +0200

    Ensure non-const pointers passed to I_CAL_IS_... functions
    
    Related to https://gitlab.gnome.org/GNOME/glib/-/issues/2353

 src/calendar/gui/e-cell-date-edit-text.c | 8 ++++----
 src/calendar/gui/e-comp-editor.c         | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/calendar/gui/e-cell-date-edit-text.c b/src/calendar/gui/e-cell-date-edit-text.c
index 9fa0446545..ff38807eb9 100644
--- a/src/calendar/gui/e-cell-date-edit-text.c
+++ b/src/calendar/gui/e-cell-date-edit-text.c
@@ -399,9 +399,9 @@ ECellDateEditValue *
 e_cell_date_edit_value_new (const ICalTime *tt,
                            const ICalTimezone *zone)
 {
-       g_return_val_if_fail (I_CAL_IS_TIME (tt), NULL);
+       g_return_val_if_fail (I_CAL_IS_TIME ((ICalTime *) tt), NULL);
        if (zone)
-               g_return_val_if_fail (I_CAL_IS_TIMEZONE (zone), NULL);
+               g_return_val_if_fail (I_CAL_IS_TIMEZONE ((ICalTimezone *) zone), NULL);
 
        return e_cell_date_edit_value_new_take (i_cal_time_clone (tt),
                zone ? e_cal_util_copy_timezone (zone) : NULL);
@@ -456,7 +456,7 @@ e_cell_date_edit_value_set_time (ECellDateEditValue *value,
                                 const ICalTime *tt)
 {
        g_return_if_fail (value != NULL);
-       g_return_if_fail (I_CAL_IS_TIME (tt));
+       g_return_if_fail (I_CAL_IS_TIME ((ICalTime *) tt));
 
        e_cell_date_edit_value_take_time (value, i_cal_time_clone (tt));
 }
@@ -490,7 +490,7 @@ e_cell_date_edit_value_set_zone (ECellDateEditValue *value,
 {
        g_return_if_fail (value != NULL);
        if (zone)
-               g_return_if_fail (I_CAL_IS_TIMEZONE (zone));
+               g_return_if_fail (I_CAL_IS_TIMEZONE ((ICalTimezone *) zone));
 
        e_cell_date_edit_value_take_zone (value, zone ? e_cal_util_copy_timezone (zone) : NULL);
 }
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index 56ba488abd..a4b8dae976 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -278,7 +278,7 @@ e_comp_editor_set_component (ECompEditor *comp_editor,
                             const ICalComponent *component)
 {
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
-       g_return_if_fail (I_CAL_IS_COMPONENT (component));
+       g_return_if_fail (I_CAL_IS_COMPONENT ((ICalComponent *) component));
 
        if (comp_editor->priv->component != component) {
                g_clear_object (&comp_editor->priv->component);
@@ -3552,7 +3552,7 @@ e_comp_editor_holds_component (ECompEditor *comp_editor,
        gboolean equal;
 
        g_return_val_if_fail (E_IS_COMP_EDITOR (comp_editor), FALSE);
-       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), FALSE);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT ((ICalComponent *) component), FALSE);
 
        if (!origin_source || !comp_editor->priv->origin_source ||
            !e_source_equal (origin_source, comp_editor->priv->origin_source))
@@ -3597,7 +3597,7 @@ e_comp_editor_open_for_component (GtkWindow *parent,
        g_return_val_if_fail (E_IS_SHELL (shell), NULL);
        if (origin_source)
                g_return_val_if_fail (E_IS_SOURCE (origin_source), NULL);
-       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT ((ICalComponent *) component), NULL);
 
        comp_editor = e_comp_editor_find_existing_for (origin_source, component);
        if (comp_editor) {
@@ -3643,7 +3643,7 @@ e_comp_editor_find_existing_for (ESource *origin_source,
 
        if (origin_source)
                g_return_val_if_fail (E_IS_SOURCE (origin_source), NULL);
-       g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL);
+       g_return_val_if_fail (I_CAL_IS_COMPONENT ((ICalComponent *) component), NULL);
 
        for (link = opened_editors; link; link = g_slist_next (link)) {
                comp_editor = link->data;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]