criticalmass: fix build on x86_64.

This commit is contained in:
Jerome Duval
2017-04-12 22:47:18 +02:00
parent 0d692446a3
commit 8d52c59b8e
2 changed files with 124 additions and 4 deletions

View File

@@ -11,11 +11,12 @@ LICENSE="CriticalMass"
REVISION="1"
commit="f597cad218830451f2ec7f5985bef23020bf28ec"
SOURCE_URI="$HOMEPAGE/archive/$commit.tar.gz"
CHECKSUM_SHA256="e53a980ec785ac14e67bf5d73013f2cd265cd7477315d1c36260fb72e97f6785"
SOURCE_DIR="critical-mass-$commit"
SOURCE_FILENAME="criticalmass-$commit.tar.gz"
CHECKSUM_SHA256="e53a980ec785ac14e67bf5d73013f2cd265cd7477315d1c36260fb72e97f6785"
PATCHES="criticalmass-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
ARCHITECTURES="x86_gcc2 ?x86 x86_64"
PROVIDES="
criticalmass = $portVersion
@@ -24,12 +25,13 @@ PROVIDES="
REQUIRES="
haiku
lib:libGL
lib:libGLU
"
BUILD_REQUIRES="
haiku_devel
devel:libgl
devel:libglu
devel:libGL
devel:libGLU
"
BUILD_PREREQUIRES="
cmd:cmake

View File

@@ -0,0 +1,118 @@
From ebfc9f3b0ac546e2008fa226669022c2374d1d59 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 12 Apr 2017 22:45:52 +0200
Subject: x86_64 build fix.
diff --git a/Headers/CMRowBrain.h b/Headers/CMRowBrain.h
index 4c9ca26..b316076 100644
--- a/Headers/CMRowBrain.h
+++ b/Headers/CMRowBrain.h
@@ -16,9 +16,9 @@ class CMRowBrain : public BLooper // class for threaded thinking
int whichRow; // which row to consider
BLooper *master; // who it reports to
bool stoppedEarly; // whether we got stopped early
- long player; // which player we are searching for
+ int32 player; // which player we are searching for
int whichCol; // which column we are considering
- long whatDepth; // what depth to search
+ int32 whatDepth; // what depth to search
CMBoard theBoard; // the common board used for all the searches
CMBoard testBoard; // kept globally to save construction
diff --git a/Sources/CMBrain.cpp b/Sources/CMBrain.cpp
index 0c2b495..ee1cf84 100644
--- a/Sources/CMBrain.cpp
+++ b/Sources/CMBrain.cpp
@@ -52,7 +52,7 @@ void CMBrain::MessageReceived(BMessage *theEvent)
break;
case CM_MSG_CELL_RESULT: // From Row Brain
{
- long row, column, value;
+ int32 row, column, value;
float percentDone;
theEvent->FindInt32("row", &row); theEvent->FindInt32("column", &column);
theEvent->FindInt32("cellValue", &value);
@@ -72,7 +72,7 @@ void CMBrain::MessageReceived(BMessage *theEvent)
}
case CM_MSG_MAKE_MOVE:
{
- long player, playerType;
+ int32 player, playerType;
CMBoard *sentBoard = NULL;
status_t errCode;
errCode = theEvent->FindPointer("thinkBoard", (void**)&sentBoard);
diff --git a/Sources/CMSound.cpp b/Sources/CMSound.cpp
index e48108b..d9cb9d5 100644
--- a/Sources/CMSound.cpp
+++ b/Sources/CMSound.cpp
@@ -4,6 +4,15 @@
#define AUDIO_SUBSCRIPTION_FAILED SUICIDE_NOTE"I couldn't connect to the audio server"
+void
+play_buffer(void *cookie, void * buffer, size_t size, const media_raw_audio_format & format)
+{
+ CMSound* playing = (CMSound*) cookie;
+
+ playing->Playback(buffer, size);
+}
+
+
CMSound::CMSound(char *soundName, char *newSoundData, long soundLength)
// constructor that takes a pointer to the sound data
{
@@ -34,15 +43,6 @@ CMSound::~CMSound() // destructor - releases the sound
} // end of ~CMSound destructor
-void
-play_buffer(void *cookie, void * buffer, size_t size, const media_raw_audio_format & format)
-{
- CMSound* playing = (CMSound*) cookie;
-
- playing->Playback(buffer, size);
-}
-
-
void CMSound::Play() // plays the sound once
{
alreadyPlaying->Acquire(); // make sure that it's not already playing
diff --git a/Sources/CMassApplication.cpp b/Sources/CMassApplication.cpp
index 2522da1..a2d3de2 100644
--- a/Sources/CMassApplication.cpp
+++ b/Sources/CMassApplication.cpp
@@ -327,7 +327,7 @@ void CMassApplication::HandleMove(BMessage *theEvent) // handle a move
{
if (waitingForAckRejectClicks) // if we have already cancelled moves
return;
- long row, column; // the row and column chosen
+ int32 row, column; // the row and column chosen
status_t errCode = theEvent->FindInt32("row", &row); // retrieve the row
if (errCode != B_NO_ERROR) // if it failed
{
diff --git a/Sources/CMassView.cpp b/Sources/CMassView.cpp
index f2d8d1c..2919d4e 100644
--- a/Sources/CMassView.cpp
+++ b/Sources/CMassView.cpp
@@ -108,7 +108,7 @@ void CMassView::Draw(BRect updateRect) // draw the view
void CMassView::MouseDown(BPoint where) // reacts to mouse clicks
{
- long whichButtons = 1; // used for tracking which buttons are down
+ int32 whichButtons = 1; // used for tracking which buttons are down
Window()->CurrentMessage()->FindInt32("buttons", &whichButtons); // find out which buttons are down
if (inGLMode && (whichButtons & B_SECONDARY_MOUSE_BUTTON)) // if we are in GL mode, and button 2 is down
@@ -123,7 +123,7 @@ void CMassView::MouseDown(BPoint where) // reacts to mouse clicks
while (whichButtons) // loop until drop the mouse
{
snooze(20 * 1000); // snooze for 20 µs
- GetMouse(&where, (ulong *)&whichButtons, true); // get the mouse location, &c.
+ GetMouse(&where, (uint32*)&whichButtons, true); // get the mouse location, &c.
vNow.x = (2.0 * where.x - frameWidth)/frameWidth; // set the vector
vNow.y = -(2.0 * where.y - frameHeight)/frameHeight; // in both dimensions
Ball_Mouse(&ball, vNow); // and pass it to the Ball functions
--
2.11.0