Typedefify command_t; simplify code accordingly.

This commit is contained in:
Jason S. Ninneman 2017-08-03 08:29:46 -07:00
parent 5c30d6429f
commit 24d102781c
4 changed files with 15 additions and 15 deletions

6
main.c
View file

@ -968,7 +968,7 @@ static void listobjects(void)
static bool do_command()
/* Get and execute a command */
{
static struct command_t command;
static command_t command;
/* Can't leave cave once it's closing (except by main office). */
if (OUTSID(game.newloc) && game.newloc != 0 && game.closng) {
@ -1051,8 +1051,8 @@ Lclearobj:
game.knfloc = 0;
/* Preserve state from last command for reuse when required */
struct command_t preserve;
memcpy(&preserve, &command, sizeof(struct command_t));
command_t preserve;
memcpy(&preserve, &command, sizeof(command_t));
// Get command input from user
if (!get_command_input(&command))