Fix build with gcc4 on amd64.
>From FreeBSD.

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/einstein/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile    3 Apr 2009 17:56:41 -0000       1.1.1.1
+++ Makefile    5 Jun 2010 11:20:04 -0000
@@ -3,6 +3,7 @@
 COMMENT =      open source remake of old DOS game Sherlock
 
 DISTNAME =     einstein-2.0
+PKGNAME =      ${DISTNAME}p0
 
 CATEGORIES =   games
 
Index: patches/patch-formatter_cpp
===================================================================
RCS file: patches/patch-formatter_cpp
diff -N patches/patch-formatter_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-formatter_cpp 5 Jun 2010 11:20:04 -0000
@@ -0,0 +1,32 @@
+$OpenBSD$
+--- formatter.cpp.orig Sun Aug 14 04:40:58 2005
++++ formatter.cpp      Sat Jun  5 13:04:52 2010
+@@ -58,7 +58,7 @@ Formatter::Formatter(unsigned char *data, int offset)
+             if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
+                     (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
+             {
+-                int no = (int)c.data;
++                long no = (long)c.data;
+                 args[no - 1] = c.type;
+             }
+         }
+@@ -123,7 +123,7 @@ class StrArgValue: public ArgValue
+ std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
+ {
+     std::wstring s;
+-    int no;
++    long no;
+ 
+     for (int i = 0; i < commandsCnt; i++) {
+         Command *cmd = &commands[i];
+@@ -135,8 +135,8 @@ std::wstring Formatter::format(std::vector<ArgValue*> 
+                 
+             case STRING_ARG:
+             case INT_ARG:
+-                no = (int)cmd->data - 1;
+-                if (no < (int)argValues.size())
++                no = (long)cmd->data - 1;
++                if (no < (long)argValues.size())
+                     s += argValues[no]->format(cmd);
+                 break;
+ 

Reply via email to