aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-09-18 04:31:36 +0800
committerIain Holmes <iain@src.gnome.org>2001-09-18 04:31:36 +0800
commit79ec5b35a834e63ef1713a8ed58f8c394db35dfe (patch)
tree172e6e84d67c635609fab26da4b7389cd15837b0 /my-evolution
parent10f836d32aadb7e5207579095da74ecb97e533be (diff)
downloadgsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.tar.gz
gsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.tar.zst
gsoc2013-evolution-79ec5b35a834e63ef1713a8ed58f8c394db35dfe.zip
Fix the use of qsort
svn path=/trunk/; revision=12906
Diffstat (limited to 'my-evolution')
-rw-r--r--my-evolution/ChangeLog5
-rw-r--r--my-evolution/e-summary-calendar.c12
-rw-r--r--my-evolution/e-summary.c1
3 files changed, 14 insertions, 4 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 4757c35759..b01c8b3297 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,8 @@
+2001-09-17 Iain Holmes <iain@ximian.com>
+
+ * e-summary-calendar.c (uids_to_array): Correctly use qsort.
+ (e_summary_calendar_event_sort_func): Dereference the e1 and e2.
+
2001-09-17 Federico Mena Quintero <federico@ximian.com>
* e-summary.c (e_summary_init): There is no need to initialize the
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c
index 789cff124a..85c14546b0 100644
--- a/my-evolution/e-summary-calendar.c
+++ b/my-evolution/e-summary-calendar.c
@@ -51,10 +51,14 @@ e_summary_calendar_event_sort_func (const void *e1,
{
ESummaryCalEvent *event1, *event2;
- event1 = (ESummaryCalEvent *) e1;
- event2 = (ESummaryCalEvent *) e2;
+ event1 = *(ESummaryCalEvent **) e1;
+ event2 = *(ESummaryCalEvent **) e2;
- return icaltime_compare (*event1->dt.value, *event2->dt.value);
+ if (event1->dt.value == NULL || event2->dt.value == NULL) {
+ return 0;
+ }
+
+ return icaltime_compare (*(event1->dt.value), *(event2->dt.value));
}
static GPtrArray *
@@ -95,7 +99,7 @@ uids_to_array (ESummary *summary,
g_ptr_array_add (array, event);
}
- qsort (array->pdata, array->len, sizeof (ESummaryCalEvent), e_summary_calendar_event_sort_func);
+ qsort (array->pdata, array->len, sizeof (ESummaryCalEvent *), e_summary_calendar_event_sort_func);
return array;
}
diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c
index 9ef4ff6f0a..582926bf10 100644
--- a/my-evolution/e-summary.c
+++ b/my-evolution/e-summary.c
@@ -38,6 +38,7 @@
#include <libgnomeprint/gnome-print-master-preview.h>
#include <gui/alarm-notify/alarm.h>
+#include <cal-util/timeutil.h>
#include "e-summary.h"
#include "e-summary-preferences.h"