[evolution-patches] (fwd) [patch] 64-bit cleanliness patch



Could you please consider this patch?

http://bugzilla.ximian.com/show_bug.cgi?id=53164
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=198660

I don't know if it's still needed in 1.5; I'll test that soon.

Package: evolution
Version: 1.4.5-3
Severity: normal
Followup-For: Bug #198660

Here is a patch to make evolution 1.4 work on ia64 (well, at least it
starts up; that's all I know how to do... ;-).

The patch fixes the following issues:

 - configure failed for me because libdb3 has a dependency on -lpthread;
   fixed by configure.in hacking

 - e-pilot-util.c was missing an include of <string.h> which caused strdup()
   to be implicitly defined to return an "int", which leads to crashes on
   64-bit platforms, because the top 32 bits will get truncated away

 - rule-context.[hc]: it was being lazy about typing and used "int" where
   GType should have been used; again this leads to crashes on 64-bit
   platforms because of pointer-truncation

 - mail-importer.c was missing an include of "e-util/epath.h", which lead
   to the implicit declaration of a function returning a pointer (sorry,
   forgot which function); this leads to the same kinds of crashes as
   the strdup() issue explained above

 - mail-vfolder.c: use GTK_CONTAINER() to avoid compiler warning (I don't
   think this patch does anything from a functionality-point of view, but
   it does remove some annoying warning messages).

Looks to me like the evolution team should do occasional testing on
64-bit platforms.  None of these bugs are ia64-specific.

Thanks,

	--david

diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/configure evolution-1.4.5-davidm/build-tree/evolution-1.4.5/configure
--- evolution-1.4.5/build-tree/evolution-1.4.5/configure	2003-12-21 03:22:57.624972411 -0800
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/configure	2003-12-20 18:19:34.385074183 -0800
@@ -23153,7 +23153,7 @@
 	ac_cv_db3_ldadd=""
 
 	for name in db db3 db-3.1; do
-		LIBS="$LIBS_save $with_db3_libs/lib${name}.a"
+		LIBS="$LIBS_save $with_db3_libs/lib${name}.a -lpthread"
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23231,7 +23231,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-	LIBS="$DB3_LDADD $LIBS"
+	LIBS="$DB3_LDADD $LIBS -lpthread"
 	if test "$cross_compiling" = yes; then
   ac_cv_db3_lib_version_match=yes
 else
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/configure.in evolution-1.4.5-davidm/build-tree/evolution-1.4.5/configure.in
--- evolution-1.4.5/build-tree/evolution-1.4.5/configure.in	2003-09-15 11:32:05.000000000 -0700
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/configure.in	2003-09-15 11:32:05.000000000 -0700
@@ -358,7 +358,7 @@
 	ac_cv_db3_ldadd=""
 
 	for name in db db3 db-3.1; do
-		LIBS="$LIBS_save $with_db3_libs/lib${name}.a"
+		LIBS="$LIBS_save $with_db3_libs/lib${name}.a -lpthread"
 		AC_TRY_LINK([
 			#ifdef HAVE_DB3_DB_H
 			#include <db3/db.h>
@@ -384,7 +384,7 @@
 
 AC_CACHE_CHECK([that db3 library version matches header version], ac_cv_db3_lib_version_match,
 [
-	LIBS="$DB3_LDADD $LIBS"
+	LIBS="$DB3_LDADD $LIBS -lpthread"
 	AC_TRY_RUN([
 		#ifdef HAVE_DB3_DB_H
 		#include <db3/db.h>
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/e-util/e-pilot-util.c evolution-1.4.5-davidm/build-tree/evolution-1.4.5/e-util/e-pilot-util.c
--- evolution-1.4.5/build-tree/evolution-1.4.5/e-util/e-pilot-util.c	2003-03-03 07:02:51.000000000 -0800
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/e-util/e-pilot-util.c	2003-12-21 00:34:23.715147274 -0800
@@ -21,6 +21,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include <time.h>
 #include <libxml/parser.h>
 #include <pi-util.h>
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/filter/rule-context.c evolution-1.4.5-davidm/build-tree/evolution-1.4.5/filter/rule-context.c
--- evolution-1.4.5/build-tree/evolution-1.4.5/filter/rule-context.c	2003-06-12 10:04:20.000000000 -0700
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/filter/rule-context.c	2003-12-21 02:59:19.219152434 -0800
@@ -209,7 +209,7 @@
 }
 
 void
-rule_context_add_part_set(RuleContext *rc, const char *setname, int part_type, RCPartFunc append, RCNextPartFunc next)
+rule_context_add_part_set(RuleContext *rc, const char *setname, GType part_type, RCPartFunc append, RCNextPartFunc next)
 {
 	struct _part_set_map *map;
 	
@@ -226,7 +226,7 @@
 }
 
 void
-rule_context_add_rule_set(RuleContext *rc, const char *setname, int rule_type, RCRuleFunc append, RCNextRuleFunc next)
+rule_context_add_rule_set(RuleContext *rc, const char *setname, GType rule_type, RCRuleFunc append, RCNextRuleFunc next)
 {
 	struct _rule_set_map *map;
 	
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/filter/rule-context.h evolution-1.4.5-davidm/build-tree/evolution-1.4.5/filter/rule-context.h
--- evolution-1.4.5/build-tree/evolution-1.4.5/filter/rule-context.h	2003-04-29 11:14:08.000000000 -0700
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/filter/rule-context.h	2003-12-21 02:21:58.041379715 -0800
@@ -85,14 +85,14 @@
 
 struct _part_set_map {
 	char *name;
-	int type;
+	GType type;
 	RCPartFunc append;
 	RCNextPartFunc next;
 };
 
 struct _rule_set_map {
 	char *name;
-	int type;
+	GType type;
 	RCRuleFunc append;
 	RCNextRuleFunc next;
 };
@@ -122,9 +122,9 @@
 int rule_context_get_rank_rule (RuleContext *rc, FilterRule *rule, const char *source);
 
 /* setup type for set parts */
-void rule_context_add_part_set (RuleContext *rc, const char *setname, int part_type,
+void rule_context_add_part_set (RuleContext *rc, const char *setname, GType part_type,
 				RCPartFunc append, RCNextPartFunc next);
-void rule_context_add_rule_set (RuleContext *rc, const char *setname, int rule_type,
+void rule_context_add_rule_set (RuleContext *rc, const char *setname, GType rule_type,
 				RCRuleFunc append, RCNextRuleFunc next);
 
 /* uri's disappear/renamed externally */
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/mail/mail-importer.c evolution-1.4.5-davidm/build-tree/evolution-1.4.5/mail/mail-importer.c
--- evolution-1.4.5/build-tree/evolution-1.4.5/mail/mail-importer.c	2003-05-21 08:53:32.000000000 -0700
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/mail/mail-importer.c	2003-12-21 00:34:09.347816199 -0800
@@ -35,6 +35,7 @@
 #include <camel/camel-stream-mem.h>
 #include <camel/camel-exception.h>
 
+#include "e-util/e-path.h"
 #include "mail-importer.h"
 #include "mail-local.h"
 #include "mail.h"
diff -x '*.so*' -x '*.lai' -x Makefile -x .libs -x '*.a' -x '*.o' -x '*.lo' -x '*.la' -x .deps -urN evolution-1.4.5/build-tree/evolution-1.4.5/mail/mail-vfolder.c evolution-1.4.5-davidm/build-tree/evolution-1.4.5/mail/mail-vfolder.c
--- evolution-1.4.5/build-tree/evolution-1.4.5/mail/mail-vfolder.c	2003-06-23 07:00:24.000000000 -0700
+++ evolution-1.4.5-davidm/build-tree/evolution-1.4.5/mail/mail-vfolder.c	2003-12-21 01:55:24.260781203 -0800
@@ -878,7 +878,7 @@
 							      GTK_STOCK_OK,
 							      GTK_RESPONSE_OK,
 							      NULL);
-		gtk_container_set_border_width ((GtkWindow *) gd, 6);
+		gtk_container_set_border_width (GTK_CONTAINER (gd), 6);
 		gtk_box_set_spacing ((GtkBox *) gd->vbox, 6);
 		gtk_dialog_set_default_response(gd, GTK_RESPONSE_OK);
 		g_object_set(gd, "allow_shrink", FALSE, "allow_grow", TRUE, NULL);
@@ -972,7 +972,7 @@
 						      GTK_RESPONSE_OK,
 						      NULL);
 	gtk_dialog_set_default_response(gd, GTK_RESPONSE_OK);
-	gtk_container_set_border_width ((GtkWindow *) gd, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (gd), 6);
 	gtk_box_set_spacing ((GtkBox *) gd->vbox, 6);
 	g_object_set(gd, "allow_shrink", FALSE, "allow_grow", TRUE, NULL);
 	gtk_window_set_default_size (GTK_WINDOW (gd), 500, 500);


-- 
Martin 

Attachment: signature.asc
Description: Digital signature



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