From fb18c656a34b6967c76facc4f4df20341e2d17df Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 11 Feb 2018 22:03:01 +0200 Subject: [PATCH] cal: fix compilation error with GCC 8.0 Fedora Rawhide has already moved to GCC 8.0 which adds the warning option -Wcast-function-type to -Wextra. Add this option to our list of additional quality flags. The code worked just by luck, because casting between sipe_public and sipe_private is in practice just a no-op. Introduce a proper callback function to remove the incorrect function cast. --- configure.ac | 1 + src/core/sipe-cal.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e6881a77..e9cb26b8 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,7 @@ AS_IF([test "x$enable_quality_check" = xyes], "-Wextra" \ "-Waggregate-return" \ "-Wcast-align" \ + "-Wcast-function-type" \ "-Wdeclaration-after-statement" \ "-Wdeprecated-declarations" \ "-Wduplicate-decl-specifier" \ diff --git a/src/core/sipe-cal.c b/src/core/sipe-cal.c index df8eb3ad..fb13f6ec 100644 --- a/src/core/sipe-cal.c +++ b/src/core/sipe-cal.c @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2010-2016 SIPE Project + * Copyright (C) 2010-2018 SIPE Project * Copyright (C) 2009 pier11 * * @@ -34,6 +34,7 @@ #include "sipe-backend.h" #include "sipe-buddy.h" +#include "sipe-common.h" #include "sipe-core.h" #include "sipe-core-private.h" #include "sipe-cal.h" @@ -1060,6 +1061,12 @@ sipe_cal_get_description(struct sipe_buddy *buddy) #define UPDATE_CALENDAR_INTERVAL (15*60) /* 15 min, default granularity for Exchange */ #define UPDATE_CALENDAR_OFFSET 30 /* 30 seconds before next interval starts */ +static void sipe_cal_update_cb(struct sipe_core_private *sipe_private, + SIPE_UNUSED_PARAMETER gpointer data) +{ + sipe_core_update_calendar(SIPE_CORE_PUBLIC); +} + void sipe_core_update_calendar(struct sipe_core_public *sipe_public) { time_t now, offset; @@ -1089,7 +1096,7 @@ void sipe_core_update_calendar(struct sipe_core_public *sipe_public) "<+update-calendar>", NULL, offset - UPDATE_CALENDAR_OFFSET, - (sipe_schedule_action)sipe_core_update_calendar, + sipe_cal_update_cb, NULL); SIPE_DEBUG_INFO_NOFORMAT("sipe_core_update_calendar: finished."); @@ -1119,7 +1126,7 @@ void sipe_cal_delayed_calendar_update(struct sipe_core_private *sipe_private) "<+update-calendar>", NULL, UPDATE_CALENDAR_DELAY, - (sipe_schedule_action) sipe_core_update_calendar, + sipe_cal_update_cb, NULL); } -- 2.11.4.GIT