openbsd-ports/games/einstein/patches/patch-formatter_cpp

33 lines
1.2 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-formatter_cpp,v 1.1 2010/06/06 12:26:55 kili Exp $
--- 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;