Commit graph

418 commits

Author SHA1 Message Date
Eric S. Raymond
ae02eac051 Add a coverage exception. 2019-02-28 13:38:08 -05:00
Eric S. Raymond
81af59974b The FORTRAN-derived longs were semantically ints. Make it so.
Note. because we used fixed-length declrations in the right places, this
shouldn't break saves.

(Besides being right, this will someday make a port to Go a touch easier,
if we decide to do that.)
2019-02-28 05:58:16 -05:00
Aaron Traas
8c6593ad0c Commenting and cleanups 2018-12-10 10:56:35 -05:00
Aaron Traas
2a5dac3d8c Abstracted a chuck of do_command() into seperate function do_move(), moved that call to main loop, so as to narrow the focus of do_command() to getting and processing commands. 2018-12-07 10:35:36 -05:00
Aaron Traas
5f4df123b4 Refactored; added state property to command struct to notate where in the lifecycle of command processing that the command is. 2018-12-05 15:05:55 -05:00
Aaron Traas
9475552be4 Major cleanups. Pre-process loop back in main loop, pre-processing abstracted into a function that makes sense. 2018-12-04 11:03:17 -05:00
Eric S. Raymond
6667ffd1f1 Address GitLab issue #45: OSX Compile issue 2018-11-30 09:50:25 -05:00
NHOrus
524f035e76 Reindentation, typo fix 2018-11-23 20:41:31 +03:00
Eric S. Raymond
f1d3b75561 Remove comments that are obsolete now that the code is goto-less. 2018-11-20 07:05:23 -05:00
Aaron Traas
a437136543 We are now goto free! 2018-11-19 17:01:31 -05:00
Aaron Traas
16545a5765 Eliminated "Lookup" label 2018-11-19 14:52:13 -05:00
Eric S. Raymond
08f77c692a Attempting voodoo change to banish GitLab error.
This shouldn't be necessary.
2018-11-18 12:39:04 -05:00
Eric S. Raymond
deb489cd8c Eliminate a label. 2018-11-16 08:30:26 -05:00
Eric S. Raymond
9a32aab879 Explicit preserve logic is no longer needed...
...now that we're not heedlessly nuking the command state.
2018-11-16 07:38:49 -05:00
Eric S. Raymond
42a42c49ac Extend coverage. 2018-11-16 07:20:58 -05:00
Eric S. Raymond
5fb6e2e1bc Magic-number elimination. 2018-11-16 05:19:31 -05:00
Eric S. Raymond
7991d007ac Choose a less obscure label name. 2018-11-15 14:03:20 -05:00
Eric S. Raymond
17e6078122 Remove some dead symbols revealed by coverage analysis. 2018-11-15 14:00:37 -05:00
Eric S. Raymond
31d561b470 Coverage improvement. Also, it's rude to die silently. 2018-11-15 13:55:10 -05:00
Eric S. Raymond
3ca9613bcd More coverage tweaks. 2018-11-15 13:33:16 -05:00
Eric S. Raymond
0590c080ee Remove unneeded code. 2018-11-14 19:08:55 -05:00
Eric S. Raymond
a4c87aa0b3 Fix for GitLab issue #37: prompt incorrectly handled. 2018-11-14 13:01:39 -05:00
Eric S. Raymond
d5d6a3e02d Handle a bare numeric token on the command line a bit more gracefully. 2018-11-11 09:05:03 -05:00
Eric S. Raymond
f01b3267c8 An attempt to fix GitLab issue #37 failed, but...
...update the condioned-out code to at least make sense with the
current versions of the data structures.
2018-03-11 23:47:43 -04:00
Eric S. Raymond
782c5c3f29 SPDXify the code. 2018-03-08 20:56:21 -05:00
NHOrus
5cdaa301dc Additional warnings
One of the two is fixed and GCC-exclusive, will cause more
warnings on Clang
2018-03-08 15:20:14 +03:00
NHOrus
0dd40bba32 Removed old copy-paste error
Put numdie bounds check in croak to prevent OOB access on negative
numdie while preserving tests
2017-09-05 17:46:38 +03:00
NHOrus
e5a0c6e2b7 Prevent tampering with PRNG parameters in save 2017-08-24 14:48:02 +03:00
NHOrus
917af2e744 Fixed copy-paste errors 2017-08-24 14:41:21 +03:00
NHOrus
0fbd79b608 Reindentation 2017-08-13 15:56:07 +01:00
Eric S. Raymond
cf92b9d9d6 Remove duplicative phase code. 2017-08-03 15:51:39 -04:00
Jason S. Ninneman
26bf324e07 Use the '=' operator (not memcpy()) to shallow-copy structs. 2017-08-03 12:41:35 -07:00
Eric S. Raymond
87c6d3fb1e Canonicalize OV commands to VO form.
Allows us to get rid of some obscure logic that causes an unnecessary
word shift. One error message changes in a benign way.
2017-08-03 15:02:41 -04:00
Eric S. Raymond
cfa37c83a7 Massage "{oil|water} {plant|door} into equivalent pourcommand.
Bedfore this change the command was passed in OV form, which we want
to get rid of.
2017-08-03 14:48:44 -04:00
Eric S. Raymond
0468da2cdf Simplify overcomplicated code. 2017-08-03 14:22:38 -04:00
Eric S. Raymond
2d618410b8 More breadcrumb improvements. 2017-08-03 12:56:50 -04:00
Eric S. Raymond
8b1533db1a Improve debugging. 2017-08-03 12:25:56 -04:00
Jason S. Ninneman
24d102781c Typedefify command_t; simplify code accordingly. 2017-08-03 08:29:46 -07:00
Jason S. Ninneman
5c30d6429f Simplify command word handling. 2017-08-03 08:24:18 -07:00
Jason S. Ninneman
5c91ea3739 Encapsulate command words into their own struct. 2017-08-03 08:24:18 -07:00
Eric S. Raymond
812d0194bb Add breadcrumbs for grammar debugging. 2017-08-03 10:54:33 -04:00
Eric S. Raymond
fd4e3aea6a Address GitLab issue #36: "Get what?" prompt incorrectly handled 2017-08-01 18:37:58 -04:00
Eric S. Raymond
878efdddfb Remove unnecessary clearing of command verb. 2017-07-31 17:40:25 -04:00
Eric S. Raymond
5d6b3aaf62 Fix a coverage gap. 2017-07-31 14:59:58 -04:00
Aaron Traas
ca5374edc3 Modified action() to take take a copy of command rather than a pointer.
It should be safer now that we're not scribbling all over command in
action(), as it's closer to pure. Also fixed a bug in say.
2017-07-21 18:27:02 -04:00
Aaron Traas
e8a627f964 Specials excised from adventure.yaml 2017-07-21 17:15:23 -04:00
Aaron Traas
5337e00725 Fix to Gitlab issue #32. Now SEED and WASTE are in adventure.yaml
NOTE: the tests are all updated because now, like every other action,
SEED and WASTE have a \n before their output, as they correctly use
SPEAK
2017-07-21 10:23:02 -04:00
Eric S. Raymond
a3c159660b Comment cleanup, semantic types, information hiding. 2017-07-21 07:38:09 -04:00
Eric S. Raymond
609159ad6d Abolish as many undifferentiated long variables as possible.
Simple counter become ints.
2017-07-20 18:49:08 -04:00
Aaron Traas
a167945e19 Information hiding - moved all of command input parsing to misc.c
get_command_input() is effectively an I/O function that takes raw input
and makes it into a command_t. With other I/O functions, it belongs in
misc.c.

This alos allowed me to make 4 other functions static, as they were only
called by get_command_input();
2017-07-20 16:02:54 -04:00