summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-19 23:24:42 +0000
committerrubidium <rubidium@openttd.org>2008-12-19 23:24:42 +0000
commitfbc0e5edbec0df0984146fe3507fa0b9753d072f (patch)
tree0665fd1072502939ffad208b61f53af054ebede0 /src/strgen
parent0f72032d440d17d96c65c536e070624efe26675d (diff)
downloadopenttd-fbc0e5edbec0df0984146fe3507fa0b9753d072f.tar.xz
(svn r14697) -Fix: some int vs unsigned int comparisons in strgen.
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index ba6a9bb40..53864716d 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -90,12 +90,12 @@ static byte _lang_textdir;
static uint16 _lang_winlangid;
#define MAX_NUM_GENDER 8
static char _genders[MAX_NUM_GENDER][16];
-static int _numgenders;
+static uint _numgenders;
// contains the name of all cases.
#define MAX_NUM_CASES 50
static char _cases[MAX_NUM_CASES][16];
-static int _numcases;
+static uint _numcases;
// for each plural value, this is the number of plural forms.
static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4, 2 };
@@ -108,7 +108,7 @@ struct CmdPair {
};
struct ParsedCommandStruct {
- int np;
+ uint np;
CmdPair pairs[32];
const CmdStruct *cmd[32]; // ordered by param #
};
@@ -704,7 +704,7 @@ static void ExtractCommandString(ParsedCommandStruct* p, const char* s, bool war
if (ar->consumes) {
if (argno != -1) argidx = argno;
- if (argidx < 0 || argidx >= lengthof(p->cmd)) error("invalid param idx %d", argidx);
+ if (argidx < 0 || (uint)argidx >= lengthof(p->cmd)) error("invalid param idx %d", argidx);
if (p->cmd[argidx] != NULL && p->cmd[argidx] != ar) error("duplicate param idx %d", argidx);
p->cmd[argidx++] = ar;
@@ -741,7 +741,7 @@ static bool CheckCommandsMatch(char *a, char *b, const char *name)
{
ParsedCommandStruct templ;
ParsedCommandStruct lang;
- int i, j;
+ uint i, j;
bool result = true;
ExtractCommandString(&templ, b, true);
@@ -1073,7 +1073,7 @@ static int TranslateArgumentIdx(int argidx)
{
int i, sum;
- if (argidx < 0 || argidx >= lengthof(_cur_pcs.cmd))
+ if (argidx < 0 || (uint)argidx >= lengthof(_cur_pcs.cmd))
error("invalid argidx %d", argidx);
for (i = sum = 0; i < argidx; i++) {