diff options
author | jacula <jacula@FreeBSD.org> | 2010-09-11 01:11:28 +0800 |
---|---|---|
committer | jacula <jacula@FreeBSD.org> | 2010-09-11 01:11:28 +0800 |
commit | 53d31c8b2ff641f3068a0c6d9e205125ec6473ca (patch) | |
tree | 4c9a999970d43126d0d1c45f35e21072495636d7 /games/magiccube4d | |
parent | fe4f7d6d61c650702cb3afac7db17a4a8bcbc7b8 (diff) | |
download | freebsd-ports-gnome-53d31c8b2ff641f3068a0c6d9e205125ec6473ca.tar.gz freebsd-ports-gnome-53d31c8b2ff641f3068a0c6d9e205125ec6473ca.tar.zst freebsd-ports-gnome-53d31c8b2ff641f3068a0c6d9e205125ec6473ca.zip |
- Make it usable on 64-bit arch
PR: ports/149394
Submitted by: Gennady Proskurin <gpr@mail.ru>
Approved by: Jeremy <karlj000@unbc.ca> (maintainer), pgj (mentor)
Diffstat (limited to 'games/magiccube4d')
-rw-r--r-- | games/magiccube4d/Makefile | 10 | ||||
-rw-r--r-- | games/magiccube4d/files/patch-EventHandler.cpp | 65 |
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); |