From 37a6e0dc8fa52531136c65ae8e0797bb1557fc89 Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org>
Date: Mon, 24 Mar 2014 22:12:11 +0100
Subject: [PATCH] Fix compilation on x86_64

---
 application/Debug.h                    |  4 ++--
 application/ImageButton.cpp            | 10 ++++++----
 application/MainWindow.cpp             |  8 ++++----
 application/Tools.h                    | 10 ++++++----
 libs/columnlistview/ColumnListView.cpp |  4 ++--
 5 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/application/Debug.h b/application/Debug.h
index 0cdf14a..ee14cef 100644
--- a/application/Debug.h
+++ b/application/Debug.h
@@ -91,7 +91,7 @@ public:
         return( *this );
     }
 
-    Debug& operator<<(int32 number)
+    Debug& operator<<(long number)
     {
         fStr << number;
         return *this;
@@ -143,7 +143,7 @@ public:
     Debug& operator<<(int)              { return *this; }
     Debug& operator<<(uint)             { return *this; }
     Debug& operator<<(char)             { return *this; }
-    Debug& operator<<(int32)            { return *this; }
+    Debug& operator<<(long)            { return *this; }
     bool const&  state(void)            { return fState; }
     void Clear(void)                    {               }
 
diff --git a/application/ImageButton.cpp b/application/ImageButton.cpp
index fc1ed66..2609613 100644
--- a/application/ImageButton.cpp
+++ b/application/ImageButton.cpp
@@ -8,6 +8,8 @@
  */
 #include "ImageButton.h"
 
+#include <stdint.h>
+
 #include <algorithm>
 
 #include <Application.h>
@@ -248,12 +250,12 @@ ImageButton::_RescaleBitmap(const BBitmap* src, int32 width, int32 height)
 	void* srcData = src->Bits();
 
 	for (int32 y = 0; y <= height; y++) {
-		void* dstRow = (void*)((uint32)dstData + (uint32)(y * dstYOff));
-		void* srcRow = (void*)((uint32)srcData + ((uint32)(y * dy) * srcYOff));
+		void* dstRow = (void*)((uintptr_t)dstData + (uintptr_t)(y * dstYOff));
+		void* srcRow = (void*)((uintptr_t)srcData + ((uintptr_t)(y * dy) * srcYOff));
 
 		for (int32 x = 0; x <= width; x++)
-			memcpy((void*)((uint32)dstRow + (x * bpp)), (void*)((uint32)srcRow
-                                              + ((uint32)(x * dx) * bpp)), bpp);
+			memcpy((void*)((uintptr_t)dstRow + (x * bpp)), (void*)((uintptr_t)srcRow
+                                              + ((uintptr_t)(x * dx) * bpp)), bpp);
 	}
 
 	return res;
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index e8002bd..af73601 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -316,10 +316,10 @@ MainWindow::_SaveSettings(void)
     
     if (fDocumentLayout != nullptr) {
     	settings
-        	<< "Split10"        << fSplitView1->ItemWeight(0L)
-        	<< "Split11"        << fSplitView1->ItemWeight(1L)
-        	<< "Split20"        << fSplitView2->ItemWeight(0L)
-        	<< "Split21"        << fSplitView2->ItemWeight(1L)
+        	<< "Split10"        << fSplitView1->ItemWeight(0)
+        	<< "Split11"        << fSplitView1->ItemWeight(1)
+        	<< "Split20"        << fSplitView2->ItemWeight(0)
+        	<< "Split21"        << fSplitView2->ItemWeight(1)
         	<< "RibbonTab"      << fRibbon->ActiveTab()
         	<< "SidebarTab"     << fTabView1->Selection()
         	<< "Fullscreen"     << (int32)fFullscreenIsOn
diff --git a/application/Tools.h b/application/Tools.h
index 4941ac0..f994a6b 100644
--- a/application/Tools.h
+++ b/application/Tools.h
@@ -9,6 +9,8 @@
 #ifndef TOOLS_H
 #define	TOOLS_H
 
+#include <stdint.h>
+
 #include <memory>
 #include <vector>
 
@@ -266,12 +268,12 @@ public:
 		void* srcData = src->Bits();
 	
 		for (int32 y = 0; y <= height; y++) {
-			void* dstRow = (void*)((uint32)dstData + (uint32)(y * dstYOff));
-			void* srcRow = (void*)((uint32)srcData + ((uint32)(y * dy) * srcYOff));
+			void* dstRow = (void*)((uintptr_t)dstData + (uintptr_t)(y * dstYOff));
+			void* srcRow = (void*)((uintptr_t)srcData + ((uintptr_t)(y * dy) * srcYOff));
 	
 			for (int32 x = 0; x <= width; x++)
-				memcpy((void*)((uint32)dstRow + (x * bpp)), (void*)((uint32)srcRow
-	                                              + ((uint32)(x * dx) * bpp)), bpp);
+				memcpy((void*)((uintptr_t)dstRow + (x * bpp)), (void*)((uintptr_t)srcRow
+	                                              + ((uintptr_t)(x * dx) * bpp)), bpp);
 		}
 		
 		std::unique_ptr<BBitmap> bitmap(res);
diff --git a/libs/columnlistview/ColumnListView.cpp b/libs/columnlistview/ColumnListView.cpp
index baa05a2..fe3bbcb 100644
--- a/libs/columnlistview/ColumnListView.cpp
+++ b/libs/columnlistview/ColumnListView.cpp
@@ -454,7 +454,7 @@ BRow::BRow(float height)
 BRow::~BRow()
 {
 	while (true) {
-		BField* field = (BField*) fFields.RemoveItem(0L);
+		BField* field = (BField*) fFields.RemoveItem(0);
 		if (field == 0)
 			break;
 
@@ -750,7 +750,7 @@ BColumnListView::BColumnListView(const char* name, uint32 flags,
 
 BColumnListView::~BColumnListView()
 {
-	while (BColumn* column = (BColumn*)fColumns.RemoveItem(0L))
+	while (BColumn* column = (BColumn*)fColumns.RemoveItem(0))
 		delete column;
 }
 
-- 
1.8.3.4

