remove igetstrtoken, a confusing helper function that was hardly used at all.

This commit is contained in:
Enno Rehling 2014-12-18 17:47:49 +01:00
parent da1d3c49c3
commit 2966e1ea3d
4 changed files with 20 additions and 30 deletions

View File

@ -794,15 +794,6 @@ parse(keyword_t kword, int(*dofun) (unit *, struct order *), bool thisorder)
}
}
const char *igetstrtoken(const char *initstr)
{
if (initstr != NULL) {
init_tokens_str(initstr, NULL);
}
return getstrtoken();
}
unsigned int getuint(void)
{
const char *s = getstrtoken();

View File

@ -112,8 +112,6 @@ extern "C" {
unsigned int getuint(void);
int getint(void);
const char *igetstrtoken(const char *s);
param_t findparam(const char *s, const struct locale *lang);
param_t findparam_ex(const char *s, const struct locale * lang);
bool isparam(const char *s, const struct locale * lang, param_t param);

View File

@ -246,13 +246,6 @@ static faction *factionorders(void)
return f;
}
/* ------------------------------------------------------------- */
static param_t igetparam(const char *s, const struct locale *lang)
{
return findparam(igetstrtoken(s), lang);
}
int readorders(const char *filename)
{
FILE *F = NULL;
@ -275,8 +268,12 @@ int readorders(const char *filename)
while (b) {
const struct locale *lang = f ? f->locale : default_locale;
int p;
switch (igetparam(b, lang)) {
param_t p;
const char *s;
init_tokens_str(b, NULL);
s = getstrtoken();
p = s ? findparam(s, lang) : NOPARAM;
switch (p) {
#undef LOCALE_CHANGE
#ifdef LOCALE_CHANGE
case P_LOCALE:
@ -308,9 +305,12 @@ int readorders(const char *filename)
if (!f || !unitorders(F, enc_gamedata, f))
do {
b = getbuf(F, enc_gamedata);
if (!b)
if (!b) {
break;
p = (b[0] == '@') ? NOPARAM : igetparam(b, lang);
}
init_tokens_str(b, NULL);
b = getstrtoken();
p = (!b || b[0] == '@') ? NOPARAM : findparam(b, lang);
} while ((p != P_UNIT || !f) && p != P_FACTION && p != P_NEXT
&& p != P_GAMENAME);
break;

View File

@ -2615,7 +2615,8 @@ static int hunt(unit * u, order * ord)
/* In command steht jetzt das NACH-Kommando. */
/* NACH ignorieren und Parsing initialisieren. */
igetstrtoken(command);
init_tokens_str(command, NULL);
getstrtoken();
/* NACH ausführen */
move(u, false);
return 1; /* true -> Einheitenliste von vorne durchgehen */