forked from github/server
remove igetstrtoken, a confusing helper function that was hardly used at all.
This commit is contained in:
parent
da1d3c49c3
commit
2966e1ea3d
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
@ -1856,7 +1856,7 @@ int writegame(const char *filename)
|
|||
|
||||
log_printf(stdout, "\nOk.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int a_readint(attrib * a, void *owner, struct storage *store)
|
||||
{
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue