aboutsummaryrefslogtreecommitdiff
path: root/games/magiccube4d
diff options
context:
space:
mode:
authorGiuseppe Pilichi <jacula@FreeBSD.org>2010-09-10 17:11:28 +0000
committerGiuseppe Pilichi <jacula@FreeBSD.org>2010-09-10 17:11:28 +0000
commitd19953a33bc4169396a06ac8fee29e2d6bbcd62d (patch)
tree5677686f09b67155a924b9ec4aa07548d01f50f2 /games/magiccube4d
parentb9166c0828e1d6879ea4462dbcbb28a7050f69d3 (diff)
downloadports-d19953a33bc4169396a06ac8fee29e2d6bbcd62d.tar.gz
ports-d19953a33bc4169396a06ac8fee29e2d6bbcd62d.zip
Notes
Diffstat (limited to 'games/magiccube4d')
-rw-r--r--games/magiccube4d/Makefile10
-rw-r--r--games/magiccube4d/files/patch-EventHandler.cpp65
2 files changed, 65 insertions, 10 deletions
diff --git a/games/magiccube4d/Makefile b/games/magiccube4d/Makefile
index 862ab2e755a7..5b94469bad51 100644
--- a/games/magiccube4d/Makefile
+++ b/games/magiccube4d/Makefile
@@ -22,10 +22,6 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-src-${PORTVERSION:S/./_/}
DOCS= ChangeLog Intro.txt MagicCube4D-unix.txt \
ideas.txt readme-unix.txt
-post-patch:
- @${REINPLACE_CMD} -e 's/stickers)()/stickers)(0)/' \
- ${WRKSRC}/EventHandler.cpp
-
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/magiccube4d ${PREFIX}/bin
.if !defined(NOPORTDOCS)
@@ -37,10 +33,4 @@ do-install:
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 700042
-.if ${ARCH} == "amd64" || ${ARCH} == "sparc64"
-BROKEN= Does not compile with GCC 4.2
-.endif
-.endif
-
.include <bsd.port.post.mk>
diff --git a/games/magiccube4d/files/patch-EventHandler.cpp b/games/magiccube4d/files/patch-EventHandler.cpp
new file mode 100644
index 000000000000..057e0a9b0532
--- /dev/null
+++ b/games/magiccube4d/files/patch-EventHandler.cpp
@@ -0,0 +1,65 @@
+diff --git EventHandler.cpp EventHandler.cpp
+index 398fcb7..f5fe00a 100644
+--- EventHandler.cpp
++++ EventHandler.cpp
+@@ -31,6 +31,9 @@ DESCRIPTION:
+ #include "MacroManager.h"
+ #include "PostScriptWriter.h"
+
++#include <stdint.h>
++static intptr_t ptr2int(const void* p) { return reinterpret_cast<intptr_t>(p); }
++
+ float const EventHandler::DEF_TWIST_INCREMENT = 0.5;
+
+ EventHandler::EventHandler(int argc, char **argv, char const* machine_type) :
+@@ -326,7 +329,7 @@ EventHandler::getAReferenceSticker(Event *event, void *)
+ number_of_reference_stickers_needed--;
+ reference_stickers_needed++;
+ if (number_of_reference_stickers_needed == 0)
+- (this->*what_to_do_after_got_reference_stickers)();
++ (this->*what_to_do_after_got_reference_stickers)(NULL);
+ }
+ }
+
+@@ -415,7 +418,7 @@ EventHandler::buttonDown_handler(Event *event, void *arg)
+ void
+ EventHandler::undo_cb(void* argp)
+ {
+- int arg = (int) argp;
++ int arg = ptr2int(argp);
+ struct stickerspec grip;
+ int dir;
+ int slicesmask;
+@@ -461,7 +464,7 @@ EventHandler::undo_cb(void* argp)
+ void
+ EventHandler::redo_cb(void* argp)
+ {
+- int arg = (int) argp;
++ int arg = ptr2int(argp);
+ struct stickerspec grip;
+ int dir;
+ int slicesmask;
+@@ -507,7 +510,7 @@ EventHandler::redo_cb(void* argp)
+ void
+ EventHandler::scramble_cb(void *arg = NULL)
+ {
+- int n = (int)arg;
++ int n = ptr2int(arg);
+ struct stickerspec grip;
+ int i, previous_face = -1;
+ int ngrips = NFACES * 3 * 3 * 3;
+@@ -855,12 +858,12 @@ EventHandler::toggleFast_cb(void *)
+ void
+ EventHandler::newPuzzle_cb(void* arg)
+ {
+- if ((int)arg == preferences.getLength())
++ if (ptr2int(arg) == preferences.getLength())
+ {
+ reset_cb(0);
+ return;
+ }
+- preferences.setLength((int)arg);
++ preferences.setLength(ptr2int(arg));
+ int length = preferences.getLength();
+
+ polymgr->reset(length);