Commit Graph

134 Commits

Author SHA1 Message Date
joerg 0dc972e776 Use __c99inline from sys/cdefs.h 2010-12-08 17:06:35 +00:00
dholland 388218390b Rework the game startup so it uses curses nicely. There are now menus
and stuff for picking scenarios and ships and all that.
2010-08-06 09:14:40 +00:00
dholland 66d93095d6 Don't define esc-[ as a custom key sequence because it steps on vt
function keys.
2010-08-06 03:10:26 +00:00
he 76d4444c78 When using -lcurses, you also need -lterminfo.
This fixes the build for sun2, and also builds with LDSTATIC=-static,
since archive libraries don't record inter-library dependencies.
2010-02-06 23:45:24 +00:00
wiz 4c5d0b1878 Close file when finished with it. Found by cppcheck. 2010-01-17 22:56:32 +00:00
dholland da121b3331 sprinkle static 2009-08-12 08:54:54 +00:00
dholland d7038c0ebc Simplify previous; suggested by Paul Goyette 2009-03-15 22:19:23 +00:00
dholland b2008ab5d1 Fix sign-compare problem that crept in due to working from an old tree.
Whoops. won't happen again...
2009-03-15 20:11:24 +00:00
dholland 87d1d157b3 Rework curses handling.
The most visible change is that the scrolling buffer of messages now
actually scrolls and keeps history, and you type on the bottom line only.
For now you can page through the history with ^P/^N; that's not ideal but
one can't fix everything all at once.

Use resizeable array code (roughly the same that I floated a while ago
in connection with make) to hold the scroll.
2009-03-15 03:33:56 +00:00
dholland 5368eaecca Move newturn() from pl_7 to pl_2.
pl_7 was mostly curses/display stuff, is going to be all display stuff.
pl_2 is where the main loop lives.
2009-03-15 00:50:47 +00:00
dholland 842019525c Move all curses bits to pl_7.c. 2009-03-15 00:35:42 +00:00
dholland 81060ec63a Fix usage message 2009-03-14 23:51:35 +00:00
dholland cb17dc26ee chdir to /var/games/sail while running, to simplify name handling. 2009-03-14 23:47:18 +00:00
dholland 86056f1213 Don't crosswire the two kinds of path names, and don't croak on
scenario numbers > 99.
2009-03-14 23:12:20 +00:00
dholland 0c94ee2110 Turns out the W_FILE message wasn't ever used. 2009-03-14 22:54:05 +00:00
dholland e544d2b874 Create some abstraction for sending messages.
Make a send and receive function for each possible message.
Make these have useful argument signatures.
Hide the list of message codes inside sync.c.
2009-03-14 22:52:52 +00:00
dholland 32aeef110b Don't use perror() 2009-03-14 20:14:56 +00:00
dholland 2a767ad336 constify the version string 2009-03-14 20:10:43 +00:00
dholland 49bf5e73fa Sprinkle some "bool". And don't use '\0' to mean 'false'. 2009-03-14 20:04:43 +00:00
dholland ac571eb080 Use \a instead of \7 for BEL. 2009-03-14 19:57:14 +00:00
dholland 4c26b16462 Prune a comment referring to objects that (AFAICT) didn't even exist in -r1.1. 2009-03-14 19:55:16 +00:00
dholland 3b67879708 Don't cast the return value of calloc(). 2009-03-14 19:36:42 +00:00
dholland b8c43a1f9c Lines <= 80 chars, remove trailing whitespace, other formatting adjustments.
No functional change.
2009-03-14 19:35:13 +00:00
dholland 9a83480957 Remove some unnecessary casts. 2009-03-14 18:41:21 +00:00
dholland 25e9926383 String buffer cleanup. sprintf bad. 2009-03-14 18:32:47 +00:00
dholland 1bb89ee28f Don't use char for random state variables; use int or bool. 2009-03-14 17:10:01 +00:00
dholland 265bf6cfdf sprintf -> snprintf 2009-03-09 04:38:39 +00:00
dholland 6b7874a086 Move HISTORY to proper place. 2009-03-02 10:16:54 +00:00
dholland 442e8c0016 Edit. Sync with reality, at least partway. Bump date. 2009-03-02 10:14:41 +00:00
wiz a14b6c39ff Sort options. End sentence with a dot. 2009-03-02 09:39:10 +00:00
dholland 3a16d1fa6d mdocify. Partly merged from OpenBSD. Not by any means perfect yet. 2009-03-02 09:23:57 +00:00
dholland f521abdfac More fixes from OpenBSD: use err instead of perror, don't hork on EOF
during the initial setup questions.
2009-03-02 07:33:30 +00:00
dholland 53cddab9f9 Check for failure of fgets when reading the captain's name, and don't
allow it to be empty. From OpenBSD.
2009-03-02 07:21:56 +00:00
dholland 51cc47ce79 Use errx() to send fatal error messages. From OpenBSD. 2009-03-02 07:17:24 +00:00
dholland ffb1e863de Use errx/warnx instead of printing to stderr. From OpenBSD. 2009-03-02 06:54:01 +00:00
dholland 96e08ad443 Use err(3) and errx(3), not perror and fprintf to stderr. From OpenBSD. 2009-03-02 06:44:22 +00:00
dholland da767c0864 Braces around a nested if, for clarity; suggested by diffing against OpenBSD. 2009-03-02 06:43:53 +00:00
lukem 2fe2731d3f Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dholland d4f48e67da Make the default WARNS for games 4. The only game that needs to set WARNS
to anything else now is rogue, so clear WARNS from the other makefiles.
2008-01-28 07:03:58 +00:00
dholland a627b0395f Build with WARNS=4. Sort out the game's shadowing of its own variables,
which fixes at least one bug.
2008-01-28 01:58:01 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
mrg 06b50ed8b9 don't try to switch a char and have a case of EOF - use an int. 2006-05-18 18:42:59 +00:00
drochner d8da09bdaf fix buffer overflow (CVE-2006-1744), from Debian 2006-04-20 10:57:26 +00:00
christos 2197ff9156 Coverity CID 980: Prevent an impossible NULL point deref. 2006-03-19 00:41:46 +00:00
abs a3edf3e145 If none of the boarding parties are set do not fall off the end of the
list. Addresses Coverity CID 1507. Also put pointers before shorts in
a struct rather than mixing them up
2006-03-18 01:43:52 +00:00
wiz d9f5a9df01 Use standard AUTHORS section header. From YOMURA Masanori in private mail
Sort sections if necessary. Use more/better markup.
2005-09-15 02:09:41 +00:00
dsl 49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30:31 +00:00
jrf 190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
jsm 5c6ba47786 Use standard C abs function rather than local macro. 2004-02-08 00:32:48 +00:00