[Xfce4-commits] <xfce4-weather-plugin:master> Remove unused functions.

Harald Judt noreply at xfce.org
Mon Dec 10 19:58:03 CET 2012


Updating branch refs/heads/master
         to 729c9a82c37670ac5b155340d6e8f9080b3456c2 (commit)
       from bf677ce8060735744f29ae3578ddc256546cff6c (commit)

commit 729c9a82c37670ac5b155340d6e8f9080b3456c2
Author: Harald Judt <h.judt at gmx.at>
Date:   Mon Dec 10 19:25:18 2012 +0100

    Remove unused functions.

 panel-plugin/weather-data.c |   89 -------------------------------------------
 1 files changed, 0 insertions(+), 89 deletions(-)

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index d3b8a4d..02a8399 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -584,95 +584,6 @@ time_calc_day(const struct tm time_tm,
 
 
 /*
- * Find timeslice of the given interval near start and end
- * times. Shift maximum prev_hours_limit hours into the past and
- * next_hours_limit hours into the future.
- */
-static xml_time *
-find_timeslice(xml_weather *wd,
-               struct tm start_tm,
-               struct tm end_tm,
-               const gint prev_hours_limit,
-               const gint next_hours_limit)
-{
-    xml_time *timeslice;
-    time_t start_t, end_t;
-    gint hours = 0;
-
-    /* set start and end times to the exact hour */
-    end_tm.tm_min = start_tm.tm_min = 0;
-    end_tm.tm_sec = start_tm.tm_sec = 0;
-
-    while (hours >= prev_hours_limit && hours <= next_hours_limit) {
-        /* check previous hours */
-        if ((0 - hours) >= prev_hours_limit) {
-            start_t = time_calc_hour(start_tm, 0 - hours);
-            end_t = time_calc_hour(end_tm, 0 - hours);
-
-            if ((timeslice = get_timeslice(wd, start_t, end_t, NULL)))
-                return timeslice;
-        }
-
-        /* check later hours */
-        if (hours != 0 && hours <= next_hours_limit) {
-            start_t = time_calc_hour(start_tm, hours);
-            end_t = time_calc_hour(end_tm, hours);
-
-            if ((timeslice = get_timeslice(wd, start_t, end_t, NULL)))
-                return timeslice;
-        }
-        hours++;
-    }
-    return NULL;
-}
-
-
-/*
- * Find the timeslice with the shortest interval near the given start
- * and end times
- */
-static xml_time *
-find_shortest_timeslice(xml_weather *wd,
-                        struct tm start_tm,
-                        struct tm end_tm,
-                        const gint prev_hours_limit,
-                        const gint next_hours_limit,
-                        const gint interval_limit)
-{
-    xml_time *interval_data;
-    time_t start_t, end_t;
-    gint interval;
-
-    /* set start and end times to the exact hour */
-    end_tm.tm_min = start_tm.tm_min = 0;
-    end_tm.tm_sec = start_tm.tm_sec = 0;
-
-    start_t = mktime(&start_tm);
-    end_t = mktime(&end_tm);
-
-    start_tm = *localtime(&start_t);
-    end_tm = *localtime(&end_t);
-
-    /* minimum interval is provided by start_tm and end_tm */
-    interval = (gint) (difftime(end_t, start_t) / 3600);
-
-    while (interval <= interval_limit) {
-        interval_data = find_timeslice(wd, start_tm, end_tm,
-                                       prev_hours_limit, next_hours_limit);
-        if (interval_data != NULL)
-            return interval_data;
-
-        interval++;
-        start_t = mktime(&start_tm);
-        end_t = time_calc_hour(end_tm, interval);
-        start_tm = *localtime(&start_t);
-        end_tm = *localtime(&end_t);
-    }
-    return NULL;
-}
-
-
-/*
  * Compare two xml_time structs using their start and end times,
  * returning the result as a qsort()-style comparison function (less
  * than zero for first arg is less than second arg, zero for equal,


More information about the Xfce4-commits mailing list