diff options
author | Allen Winter <allen.winter@kdab.com> | 2019-06-30 15:40:50 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2019-07-13 16:28:19 -0400 |
commit | 4dbac3a8f82bcc76cf7726b07e86530920ee9870 (patch) | |
tree | f7b45f3603272647c0700f7d9b073c2c71448f80 | |
parent | 7453fdab7651e12c7c5de1c17c3f3bd4a36a328d (diff) | |
download | libical-git-4dbac3a8f82bcc76cf7726b07e86530920ee9870.tar.gz |
src/libical/icaltimezone.c - fix splint warnings
-rw-r--r-- | src/libical/icaltimezone.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/libical/icaltimezone.c b/src/libical/icaltimezone.c index fe59cb4c..3e8ed883 100644 --- a/src/libical/icaltimezone.c +++ b/src/libical/icaltimezone.c @@ -2175,8 +2175,8 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, icalcomponent *comp, *nextc, *tomb_std = NULL, *tomb_day = NULL; icalproperty *prop, *proleptic_prop = NULL; struct observance tombstone; - unsigned need_tomb = !icaltime_is_null_time(start); - unsigned need_tzuntil = !icaltime_is_null_time(end); + unsigned need_tomb = (unsigned)!icaltime_is_null_time(start); + unsigned need_tzuntil = (unsigned)!icaltime_is_null_time(end); if (!need_tomb && !need_tzuntil) { /* Nothing to do */ @@ -2209,7 +2209,8 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, icalarray *rdates = icalarray_new(sizeof(struct rdate), 10); icaltimetype dtstart; struct observance obs; - unsigned n, trunc_dtstart = 0; + size_t n; + unsigned trunc_dtstart = 0; int r; nextc = icalcomponent_get_next_component(vtz, ICAL_ANY_COMPONENT); @@ -2273,7 +2274,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, /* Adjust DTSTART observance to UTC */ icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from); - icaltime_set_timezone(&obs.onset, icaltimezone_get_utc_timezone()); + (void)icaltime_set_timezone(&obs.onset, icaltimezone_get_utc_timezone()); /* Check DTSTART vs window close */ if (need_tzuntil && icaltime_compare(obs.onset, end) >= 0) { @@ -2303,7 +2304,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, if (rrule_prop) { struct icalrecurrencetype rrule = icalproperty_get_rrule(rrule_prop); - unsigned eternal = icaltime_is_null_time(rrule.until); + unsigned eternal = (unsigned)icaltime_is_null_time(rrule.until); icalrecur_iterator *ritr = NULL; unsigned trunc_until = 0; @@ -2330,7 +2331,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, if (!eternal) { /* Adjust UNTIL to local time (for iterator) */ icaltime_adjust(&rrule.until, 0, 0, 0, obs.offset_from); - icaltime_set_timezone(&rrule.until, NULL); + (void)icaltime_set_timezone(&rrule.until, NULL); } ritr = icalrecur_iterator_new(rrule, dtstart); @@ -2341,7 +2342,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, newstart.year = start.year - 1; newstart.month = start.month; newstart.day = start.day; - icaltime_normalize(newstart); + (void)icaltime_normalize(newstart); icalrecur_iterator_set_start(ritr, newstart); } } @@ -2357,14 +2358,14 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, /* Adjust observance to UTC */ icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from); - icaltime_set_timezone(&obs.onset, - icaltimezone_get_utc_timezone()); + (void)icaltime_set_timezone(&obs.onset, + icaltimezone_get_utc_timezone()); if (trunc_until && icaltime_compare(obs.onset, end) >= 0) { /* Observance is on/after window close */ /* Check if DSTART is within 1yr of prev onset */ - ydiff = prev_onset.year - dtstart.year; + ydiff = (unsigned)(prev_onset.year - dtstart.year); if (ydiff <= 1) { /* Remove RRULE */ icalcomponent_remove_property(comp, rrule_prop); @@ -2421,7 +2422,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, trunc_dtstart = 0; /* Check if new DSTART is within 1yr of UNTIL */ - ydiff = rrule.until.year - recur.year; + ydiff = (unsigned)(rrule.until.year - recur.year); if (!trunc_until && ydiff <= 1) { /* Remove RRULE */ icalcomponent_remove_property(comp, rrule_prop); @@ -2445,14 +2446,14 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, } /* Check if observance is outside 1yr of window close */ - ydiff = end.year - recur.year; + ydiff = (unsigned)(end.year - recur.year); if (ydiff > 1) { /* Bump RRULE to restart at 1 year prior to our window close */ icaltimetype newstart = recur; newstart.year = end.year - 1; newstart.month = end.month; newstart.day = end.day; - icaltime_normalize(newstart); + (void)icaltime_normalize(newstart); icalrecur_iterator_set_start(ritr, newstart); } } @@ -2487,7 +2488,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, /* Adjust observance to UTC */ icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from); - icaltime_set_timezone(&obs.onset, icaltimezone_get_utc_timezone()); + (void)icaltime_set_timezone(&obs.onset, icaltimezone_get_utc_timezone()); if (need_tzuntil && icaltime_compare(obs.onset, end) >= 0) { /* RDATE is after our window close - remove it */ @@ -2580,7 +2581,7 @@ void icaltimezone_truncate_vtimezone(icalcomponent *vtz, case ICAL_DTSTART_PROPERTY: /* Adjust window open to local time */ icaltime_adjust(&start, 0, 0, 0, tombstone.offset_from); - icaltime_set_timezone(&start, NULL); + (void)icaltime_set_timezone(&start, NULL); icalproperty_set_dtstart(prop, start); break; |