tracker r2266 - in branches/indexer-split: . src/tracker-indexer/modules



Author: carlosg
Date: Thu Sep 25 16:14:47 2008
New Revision: 2266
URL: http://svn.gnome.org/viewvc/tracker?rev=2266&view=rev

Log:
2008-09-25  Carlos Garnacho  <carlos imendio com>

        Do not break on 64-bit platforms. Based on a patch by Laurent
        Aguerreche  <laurent aguerreche free fr>

        * src/tracker-indexer/modules/evolution.c (read_summary): time_t will
        have different width in other platforms.
        (read_summary_header): Add comments to skipped summary elements.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/tracker-indexer/modules/evolution.c

Modified: branches/indexer-split/src/tracker-indexer/modules/evolution.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/evolution.c	(original)
+++ branches/indexer-split/src/tracker-indexer/modules/evolution.c	Thu Sep 25 16:14:47 2008
@@ -131,7 +131,20 @@
 
 	while ((value_type = va_arg (args, gint)) != -1) {
 		switch (value_type) {
-		case SUMMARY_TYPE_TIME_T:
+		case SUMMARY_TYPE_TIME_T: {
+			time_t value, *dest;
+
+			if (fread (&value, sizeof (time_t), 1, summary) != 1) {
+				return FALSE;
+			}
+
+			dest = va_arg (args, time_t*);
+
+			if (dest) {
+				*dest = g_ntohl (value);
+			}
+			break;
+		}
 		case SUMMARY_TYPE_INT32: {
 			gint32 value, *dest;
 
@@ -456,17 +469,17 @@
 
 	read_summary (summary,
 		      SUMMARY_TYPE_INT32, &version,
-		      SUMMARY_TYPE_INT32, NULL,
-		      SUMMARY_TYPE_INT32, NULL,
-		      SUMMARY_TYPE_INT32, NULL,
+		      SUMMARY_TYPE_INT32, NULL,		/* flags */
+		      SUMMARY_TYPE_INT32, NULL,		/* nextuid */
+		      SUMMARY_TYPE_TIME_T, NULL,	/* time */
 		      SUMMARY_TYPE_INT32, &n_messages,
 		      -1);
 
 	if ((version < 0x100 && version >= 13)) {
 		read_summary (summary,
-			      SUMMARY_TYPE_INT32, NULL,
-			      SUMMARY_TYPE_INT32, NULL,
-			      SUMMARY_TYPE_INT32, NULL,
+			      SUMMARY_TYPE_INT32, NULL, /* unread count*/
+			      SUMMARY_TYPE_INT32, NULL, /* deleted count*/
+			      SUMMARY_TYPE_INT32, NULL, /* junk count */
 			      -1);
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]