- fix build with gcc2

This commit is contained in:
jasper 2010-09-07 10:38:40 +00:00
parent abb90d75e6
commit b1979505d7
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-src_libical_icalderivedproperty_c,v 1.1 2010/09/07 10:38:40 jasper Exp $
Fix build with gcc2.
--- src/libical/icalderivedproperty.c.orig Mon Sep 6 06:39:19 2010
+++ src/libical/icalderivedproperty.c Mon Sep 6 06:42:07 2010
@@ -1373,6 +1373,9 @@ void icalproperty_set_exdate(icalproperty* prop, struc
icalproperty_set_value(prop,value);
}
struct icaltimetype icalproperty_get_exdate(const icalproperty* prop){
+ struct icaltimetype itt;
+ icalparameter* param;
+
icalerror_check_arg( (prop!=0),"prop");
#ifndef _MSC_VER
/*
@@ -1381,10 +1384,8 @@ struct icaltimetype icalproperty_get_exdate(const ical
* it doesnot work automatically like in the other functions
* like icalproperty_get_dtstart().
*/
- struct icaltimetype itt =
- icalvalue_get_datetime(icalproperty_get_value(prop));
- icalparameter* param = icalproperty_get_first_parameter(prop,
- ICAL_TZID_PARAMETER);
+ itt = icalvalue_get_datetime(icalproperty_get_value(prop));
+ param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER);
if (param) {
const icaltimezone *zone =
icaltimezone_get_builtin_timezone(icalparameter_get_tzid(param));

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-src_libical_icalrecur_c,v 1.1 2010/09/07 10:38:40 jasper Exp $
Fix build with gcc2.
--- src/libical/icalrecur.c.orig Mon Sep 6 09:16:29 2010
+++ src/libical/icalrecur.c Mon Sep 6 14:14:53 2010
@@ -1593,10 +1593,11 @@ static int next_month(icalrecur_iterator* impl)
int day;
int days_in_month = icaltime_days_in_month(impl->last.month,
impl->last.year);
- assert( BYDAYPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX);
-
int set_pos_counter = 0;
int set_pos_total = 0;
+ int found = 0;
+
+ assert( BYDAYPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX);
/* Count the past positions for the BYSETPOS calculation */
if(has_by_data(impl,BY_SET_POS)){
@@ -1613,8 +1614,6 @@ static int next_month(icalrecur_iterator* impl)
impl->last.day = last_day;
}
- int found = 0;
-
for(day = impl->last.day+1; day <= days_in_month; day++){
impl->last.day = day;
@@ -1927,8 +1926,8 @@ static int expand_year_days(icalrecur_iterator* impl,
/* BY_WEEK_NO together with BY_MONTH - may conflict, in this case BY_MONTH wins */
if( (flags & 1<<BY_MONTH) && (flags & 1<<BY_WEEK_NO) ){
int valid_weeks[ICAL_BY_WEEKNO_SIZE];
- memset(valid_weeks, 0, sizeof(valid_weeks));
int valid = 1;
+ memset(valid_weeks, 0, sizeof(valid_weeks));
t.year = year;
t.is_date = 1;