Removed unused code, reindented
This commit is contained in:
parent
0e2c851131
commit
03b2f1c86e
3 changed files with 51 additions and 63 deletions
1
advent.h
1
advent.h
|
@ -206,7 +206,6 @@ extern void packed_to_token(long, char token[]);
|
||||||
extern long token_to_packed(const char token[]);
|
extern long token_to_packed(const char token[]);
|
||||||
extern void tokenize(char*, struct command_t *);
|
extern void tokenize(char*, struct command_t *);
|
||||||
extern void vspeak(const char*, bool, va_list);
|
extern void vspeak(const char*, bool, va_list);
|
||||||
extern bool wordeq(token_t, token_t);
|
|
||||||
extern bool wordempty(token_t);
|
extern bool wordempty(token_t);
|
||||||
extern void wordclear(token_t *);
|
extern void wordclear(token_t *);
|
||||||
extern void speak(const char*, ...);
|
extern void speak(const char*, ...);
|
||||||
|
|
23
misc.c
23
misc.c
|
@ -128,11 +128,6 @@ void tokenize(char* raw, struct command_t *cmd)
|
||||||
|
|
||||||
/* Hide the fact that wods are corrently packed longs */
|
/* Hide the fact that wods are corrently packed longs */
|
||||||
|
|
||||||
bool wordeq(token_t a, token_t b)
|
|
||||||
{
|
|
||||||
return a == b;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wordempty(token_t a)
|
bool wordempty(token_t a)
|
||||||
{
|
{
|
||||||
return a == 0;
|
return a == 0;
|
||||||
|
@ -526,8 +521,7 @@ int get_special_vocab_id(const char* word)
|
||||||
void get_vocab_metadata(const char* word, long* id, enum wordtype* type)
|
void get_vocab_metadata(const char* word, long* id, enum wordtype* type)
|
||||||
{
|
{
|
||||||
/* Check for an empty string */
|
/* Check for an empty string */
|
||||||
if (strncmp(word, "", sizeof("")) == 0)
|
if (strncmp(word, "", sizeof("")) == 0) {
|
||||||
{
|
|
||||||
*id = WORD_EMPTY;
|
*id = WORD_EMPTY;
|
||||||
*type = NO_WORD_TYPE;
|
*type = NO_WORD_TYPE;
|
||||||
return;
|
return;
|
||||||
|
@ -536,40 +530,35 @@ void get_vocab_metadata(const char* word, long* id, enum wordtype* type)
|
||||||
long ref_num;
|
long ref_num;
|
||||||
|
|
||||||
ref_num = get_motion_vocab_id(word);
|
ref_num = get_motion_vocab_id(word);
|
||||||
if (ref_num != WORD_NOT_FOUND)
|
if (ref_num != WORD_NOT_FOUND) {
|
||||||
{
|
|
||||||
*id = ref_num;
|
*id = ref_num;
|
||||||
*type = MOTION;
|
*type = MOTION;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref_num = get_object_vocab_id(word);
|
ref_num = get_object_vocab_id(word);
|
||||||
if (ref_num != WORD_NOT_FOUND)
|
if (ref_num != WORD_NOT_FOUND) {
|
||||||
{
|
|
||||||
*id = ref_num;
|
*id = ref_num;
|
||||||
*type = OBJECT;
|
*type = OBJECT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref_num = get_action_vocab_id(word);
|
ref_num = get_action_vocab_id(word);
|
||||||
if (ref_num != WORD_NOT_FOUND)
|
if (ref_num != WORD_NOT_FOUND) {
|
||||||
{
|
|
||||||
*id = ref_num;
|
*id = ref_num;
|
||||||
*type = ACTION;
|
*type = ACTION;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref_num = get_special_vocab_id(word);
|
ref_num = get_special_vocab_id(word);
|
||||||
if (ref_num != WORD_NOT_FOUND)
|
if (ref_num != WORD_NOT_FOUND) {
|
||||||
{
|
|
||||||
*id = ref_num;
|
*id = ref_num;
|
||||||
*type = SPECIAL;
|
*type = SPECIAL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for the reservoir magic word.
|
// Check for the reservoir magic word.
|
||||||
if (strcasecmp(word, game.zzword) == 0)
|
if (strcasecmp(word, game.zzword) == 0) {
|
||||||
{
|
|
||||||
*id = PART;
|
*id = PART;
|
||||||
*type = ACTION;
|
*type = ACTION;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue