[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [patch] Compile failures on amd64/gcc 4.0
From:       Alejandro Exojo <suy () kurly ! org>
Date:       2005-01-06 22:31:22
Message-ID: 200501062331.22417.suy () kurly ! org
[Download RAW message or body]

Hi.

Some bugs were filled in the Debian bug tracking system, reporting compilation 
problems on AMD 64 with gcc 4.0:

http://bugs.debian.org/288900
http://bugs.debian.org/287095
http://bugs.debian.org/287007
http://bugs.debian.org/286998

In the reports, Andreas Jochens, contributed some patches against the 3.3 
packages, but I've tried to adapt them to CVS HEAD. I'm sending them 
attached. Please, review and tell me if I should commit them.

Thanks a lot.

-- 
Alex (a.k.a. suy) - GPG ID 0x0B8B0BC2
http://darkshines.net/ - Jabber ID: suy@bulmalug.net

["kdeadmin_amd64.diff" (text/x-diff)]

Index: kpackage/packageInfo.cpp
===================================================================
RCS file: /home/kde/kdeadmin/kpackage/packageInfo.cpp,v
retrieving revision 1.40
diff -u -3 -p -r1.40 packageInfo.cpp
--- kpackage/packageInfo.cpp	25 Oct 2004 15:21:59 -0000	1.40
+++ kpackage/packageInfo.cpp	6 Jan 2005 21:40:47 -0000
@@ -114,7 +114,7 @@ void packageInfo::fixup()
 {
   if (!info->find("name")) {
     QString *q = new QString();
-    q->setNum((int)this);
+    q->setNum((long)this);
     info->insert("name", q);
   }
 

["kdegraphics_amd64.diff" (text/x-diff)]

Index: kiconedit/kiconedit.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kiconedit/kiconedit.cpp,v
retrieving revision 1.98
diff -u -3 -p -r1.98 kiconedit.cpp
--- kiconedit/kiconedit.cpp	26 Jun 2004 10:12:52 -0000	1.98
+++ kiconedit/kiconedit.cpp	6 Jan 2005 21:39:49 -0000
@@ -151,7 +151,7 @@ void KIconEdit::init()
 
 KIconEdit::~KIconEdit()
 {
-    kdDebug(4640) << "Deleting KIconEdit: " << (int)this << endl;
+    kdDebug(4640) << "Deleting KIconEdit: " << (long)this << endl;
     windowList.remove(this);
 
     if (windowList.count() < 1)

["kdelibs_amd64.diff" (text/x-diff)]

Index: kdecore/kallocator.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kallocator.cpp,v
retrieving revision 1.9
diff -u -3 -p -r1.9 kallocator.cpp
--- kdecore/kallocator.cpp	16 Dec 2002 12:59:42 -0000	1.9
+++ kdecore/kallocator.cpp	6 Jan 2005 21:37:48 -0000
@@ -82,10 +82,10 @@ KZoneAllocator::~KZoneAllocator()
 
 void KZoneAllocator::insertHash(MemBlock *b)
 {
-  unsigned int adr = ((unsigned int)b->begin) & (~(blockSize - 1));
-  unsigned int end = ((unsigned int)b->begin) + blockSize;
+  unsigned int adr = ((unsigned long)b->begin) & (~(blockSize - 1));
+  unsigned int end = ((unsigned long)b->begin) + blockSize;
   while (adr < end) {
-    unsigned int key = adr >> log2;
+    unsigned long key = adr >> log2;
     key = key & (hashSize - 1);
     if (!hashList[key])
       hashList[key] = new QValueList<MemBlock *>;
@@ -140,10 +140,10 @@ void KZoneAllocator::delBlock(MemBlock *
   /* Update also the hashlists if we aren't going to reconstruct them
      soon.  */
   if (hashList && !hashDirty) {
-    unsigned int adr = ((unsigned int)b->begin) & (~(blockSize - 1));
-    unsigned int end = ((unsigned int)b->begin) + blockSize;
+    unsigned long adr = ((unsigned long)b->begin) & (~(blockSize - 1));
+    unsigned long end = ((unsigned long)b->begin) + blockSize;
     while (adr < end) {
-      unsigned int key = adr >> log2;
+      unsigned long key = adr >> log2;
       key = key & (hashSize - 1);
       if (hashList[key]) {
 	QValueList<MemBlock *> *list = hashList[key];
@@ -199,7 +199,7 @@ KZoneAllocator::deallocate(void *ptr)
   if (hashDirty)
     initHash();
 
-  unsigned int key = (((unsigned int)ptr) >> log2) & (hashSize - 1);
+  unsigned long key = (((unsigned long)ptr) >> log2) & (hashSize - 1);
   QValueList<MemBlock *> *list = hashList[key];
   if (!list) {
     /* Can happen with certain usage pattern of intermixed free_since()
Index: kdecore/network/ksocketaddress.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/network/ksocketaddress.cpp,v
retrieving revision 1.17
diff -u -3 -p -r1.17 ksocketaddress.cpp
--- kdecore/network/ksocketaddress.cpp	1 Aug 2004 02:36:49 -0000	1.17
+++ kdecore/network/ksocketaddress.cpp	6 Jan 2005 21:37:48 -0000
@@ -226,7 +226,7 @@ struct our_sockaddr_in6
 // useful definitions
 #define MIN_SOCKADDR_LEN	sizeof(Q_UINT16)
 #define SOCKADDR_IN_LEN		sizeof(sockaddr_in)
-#define MIN_SOCKADDR_IN6_LEN	((unsigned) &(((our_sockaddr_in6*)0)->sin6_scope_id))
+#define MIN_SOCKADDR_IN6_LEN	((unsigned long) &(((our_sockaddr_in6*)0)->sin6_scope_id))
 #define SOCKADDR_IN6_LEN	sizeof(our_sockaddr_in6)
 #define MIN_SOCKADDR_UN_LEN	(sizeof(Q_UINT16) + sizeof(char))
 
Index: khtml/khtml_caret.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_caret.cpp,v
retrieving revision 1.25
diff -u -3 -p -r1.25 khtml_caret.cpp
--- khtml/khtml_caret.cpp	26 Oct 2004 14:37:16 -0000	1.25
+++ khtml/khtml_caret.cpp	6 Jan 2005 21:37:49 -0000
@@ -2103,7 +2103,7 @@ static RenderTableCell *findNearestTable
   int i;
   for (i = 0; i < n; i++) {
     RenderTableCell *cell = row->row->at(i);
-    if (!cell || (int)cell == -1) continue;
+    if (!cell || (long)cell == -1) continue;
 
     int absx, absy;
     cell->absolutePosition(absx, absy, false); // ### position: fixed?
@@ -2127,7 +2127,7 @@ static RenderTableCell *findNearestTable
     if (index < 0 || index >= n) continue;
 
     RenderTableCell *cell = row->row->at(index);
-    if (!cell || (int)cell == -1) continue;
+    if (!cell || (long)cell == -1) continue;
 
 #if DEBUG_CARETMODE > 1
     kdDebug(6201) << "index " << index << " cell " << cell << endl;
Index: khtml/xml/dom_docimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.304
diff -u -3 -p -r1.304 dom_docimpl.cpp
--- khtml/xml/dom_docimpl.cpp	17 Dec 2004 10:41:39 -0000	1.304
+++ khtml/xml/dom_docimpl.cpp	6 Jan 2005 21:37:50 -0000
@@ -1691,11 +1691,11 @@ NodeImpl::Id DocumentImpl::getId( NodeIm
     QString name = cs ? n.string() : n.string().upper();
 
     if (!_nsURI) {
-        id = (NodeImpl::Id) map->ids.find( name );
+        id = (NodeImpl::Id)(long) map->ids.find( name );
         if (!id && _type != NodeImpl::NamespaceId)
-            id = (NodeImpl::Id) map->ids.find( "aliases: " + name );
+            id = (NodeImpl::Id)(long) map->ids.find( "aliases: " + name );
     } else {
-        id = (NodeImpl::Id) map->ids.find( name );
+        id = (NodeImpl::Id)(long) map->ids.find( name );
         if (!readonly && id && _prefix && _prefix->l) {
             // we were called in registration mode... check if the alias exists
             QConstString px( _prefix->s, _prefix->l );

["kdemultimedia_amd64.diff" (text/x-diff)]

Index: noatun/modules/splitplaylist/playlist.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/noatun/modules/splitplaylist/playlist.cpp,v
retrieving revision 1.54
diff -u -3 -p -r1.54 playlist.cpp
--- noatun/modules/splitplaylist/playlist.cpp	1 Dec 2004 16:01:28 -0000	1.54
+++ noatun/modules/splitplaylist/playlist.cpp	6 Jan 2005 21:39:08 -0000
@@ -266,7 +266,7 @@ void SplitPlaylist::randomize()
 
 	for(int i = 0; i < lview->childCount(); i++)
 	{
-		items.take()->moveItem(lview->itemAtIndex((int) list.take()));
+		items.take()->moveItem(lview->itemAtIndex((long) list.take()));
 	}
 
 	setCurrent(currentItem, false);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic