Commit Graph

147 Commits

Author SHA1 Message Date
mrg f8570f8a97 fix simple mis-matched function prototype and definitions.
most of these are like, eg

   void foo(int[2]);

with either of these

   void foo(int*) { ... }
   void foo(int[]) { ... }

in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.

found by GCC 12.
2023-08-01 07:04:14 +00:00
nia a373ad5865 sail(6): convert realloc(x * y) to reallocarr 2021-10-29 11:42:34 +00:00
rillig 1182a44c59 games: remove trailing whitespace in *.c and *.h 2021-05-02 12:50:43 +00:00
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
apb fa823f4eed temp is a pointer, and tempmax, not sizeof(temp), is the length of
the buffer that it points to.  Adjust a strlcat() call to suit.
2014-03-28 17:53:47 +00:00
christos 193b880fad fix unused variable warnings 2013-10-19 17:19:30 +00:00
joerg 4511a017c1 Use __dead 2011-08-29 20:30:36 +00:00
dholland ae56ae8f3f Use __dead and __printflike instead of __attribute__. 2011-08-26 06:18:16 +00:00
christos df7b0db034 add printf attributes. 2011-08-25 16:18:28 +00:00
joerg 6e9533bc30 Uses non-literal format strings 2011-08-25 15:50:45 +00:00
christos 459966a9ab avoid non-literal format string 2011-08-16 11:26:16 +00:00
joerg 8f09f5ccbd Don't use variables as format string. 2011-05-23 23:02:07 +00:00
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