summaryrefslogtreecommitdiff
path: root/games
AgeCommit message (Collapse)Author
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2016-03-28remove unused variablesCharles Longeau
ok millert@
2016-03-21Instead of creating a socket with socket() or accept() and thenPhilip Guenther
setting the O_NONBLOCK flag on it with fcntl(F_SETFL) afterwards, just pass SOCK_NONBLOCK to socket() or accept4() and get it right to begin with. ok millert@ krw@ beck@ deraadt@ jca@
2016-03-16Prefer fseek(3) over rewind(3) since the latter although it also calls fseekmestre
then additionally it calls clearerr(3) deliberately but we want to catch any error that may happen and this way we couldn't catch it OK tb@
2016-03-15execl(3) calls must have the last argument casted to (char *)NULLmestre
At the time when this was commited me and tb@ discussed that it shouldn't be changed, but still snucked in within a larger diff that we didn't notice. OK tb@
2016-03-08- ranf() and franf() are prototyped on trek.h but ranf.c doesn't include it somestre
do it - Replace random() >> 5 by only random(): this was discussed a few months ago and naddy@ said at the time "Those games were originally written with the rand(3) function. The lower bits returned by rand(3) suffered from notoriously poor randomness, so this idiom developed where people would use the higher, more random bits." OK tb@ after his remarks
2016-03-08Headers cleanup with and OK tb@mestre
This was prompted by an initial patch sent by Edgar Pettijohn <edgar ! pettijohn-web.com> but the actual commit is different
2016-03-07eliminate do_malloc() and do_free().tb
These are wrappers for malloc(3) and free(3) with NULL checks. do_free() is pointless since free() already checks for NULL. do_malloc() is used only three times, once asprintf(3) seems more appropriate, and for just two calls the benefit of a custom wrapper is minimal. ok millert@
2016-03-07Remove unused fields posfile and was_pos_file from FILEDESC andtb
simplify is_fortfile() accordingly. The last use of them was guarded by OK_TO_WRITE_DISK, which was unifdef'ed in revision 1.43 last fall. tweak + ok mestre@
2016-03-07remove -u? from usage();Jason McIntyre
2016-03-07- General changes:mestre
- Remove -? from getopt(3) options, but still keep (or add) -h where applicable - Replace hardcoded program strings by getprogname(3) - Specific changes: - atc(6): this used -? and -u for usage(), remove both from game and manpage - bcd(6): use __progname instead of getprogname(3), no need to include stdlib.h - hunt(6): replace fputs(3) by fprintf(3) OK tb@ after his suggestions
2016-03-05Convert a hand-rolled strtonum to a call to strtonum(3). This preventstb
integer overflow on bogus input and bizarre error messages. Moreover, fortune files can now be named anything except names matching the regex ^[0-9][0-9.]*%$ ok mestre@
2016-03-05KNF: wrap three overly long lines. No binary change.tb
2016-03-04- Convert atoi(3) to strtonum(3)mestre
- Replace hardcoded program string by getprogname(3) - Remove '?' from getopt(3)'s switch default case (but still keep 'h') OK tb@ after his suggestions
2016-03-02Fix score file nameTim van der Molen
2016-02-28Add back undocumented -h switch defaulting to usage().tb
pjanzen@ correctly pointed out that a majority of games do this, so no need to deviate here.
2016-02-27Untangle a mess of nested ternary operators.tb
ok mestre@
2016-02-26- Remove -h and -? from getopt(3), they weren't documented on manpage anywaymestre
- Replace hardcoded string "hangman" by getprogname(3) OK tb@
2016-02-26- Convert atoi(3) to strtonum(3)mestre
- Remove lint-style comment - Remove usage() since errors are now more informative (the usage is still available in the manpage) With this diff I made it accept 0 as rotation whereas before it didn't, but alas if you use 0 then it defeats the whole purpose of the game. Initial diff sent by Peter Williams <peterbw at gmail.com>, tweaked by me and several hints and OK by tb@. I'm in desperate need of a coffee, thank you tb@ for making me notice that!
2016-02-09- Remove parameter fd from snscore() since it's never usedmestre
- And while here, fwrite(3) returns size_t whereas nscores is an int, so cast nscores to u_int. This is a false positive, but silences a compiler warning with -Wextra -pedantic tb@ : "Looks ok to me" after suggestion from him
2016-02-02- Swap atoi(3) for strtonum(3)mestre
- Swap fputs(3) for fprintf(3) - Use getprogname(3) instead of hardcoded string OK and help from tb@
2016-01-27- optarg and optind are declared by unistd.h, so remove them...Gleydson Soares
- use strtonum rather than atoi - zap case '?' in getopt(3) switch - use _exit(2) in signal handler - use __progname in usage() instead of hardcoded name OK tb@ mestre@
2016-01-25Remove unused headermestre
2016-01-19Teach morse(6) the <AC> prosign as '@', as added on May 24, 2004 (theStuart Henderson
160th anniversary of the first public Morse telegraph transmission). Support decoding (only; not encoding) of other prosigns, including <SK> as we were previously using for '@'. From pjanzen.
2016-01-18There are now distinct codes for left and right parentheses.Stuart Henderson
Part of a diff that was ok tb@ abieber@ deraadt@
2016-01-18Add a reference to the current ITU Morse code document.Stuart Henderson
Part of a diff that was ok abieber tb -.. . .-. .- .- -.. -; other part being revised with pjanzen.
2016-01-13there's a resource leak here. missing a fclose(3) to kill the stream.Gleydson Soares
OK deraadt@ mestre@
2016-01-10#ifdef QUEST then a few functions won't work, because of that includemestre
<stdlib.h> if we are on a QUEST OK tb@
2016-01-10Remove needless casts to (char *) NULL. Some were kept, namely for execl(3)mestre
last arguments since "The list of arguments must be terminated by a null null pointer" of type char * Suggested by and OK tb@
2016-01-10As per style(9), remove remaining lint-style comments from games/mestre
OK tb@
2016-01-10Remove unnecessary headersmestre
OK tb@
2016-01-09Remove several casts to (char *) 0 and replace them by NULLmestre
Prompted and OK by tb@
2016-01-09ANSIfy grammar.y on atc(6), all other files already aremestre
OK tb@
2016-01-09This diff is rather large, but it's just simply removing unnecessary headersmestre
, remove some lint-style comments, add missing void to functions without args, also some function prototypes (extern) were missing their args, so I added them as they were defined in hack.h OK tb@ on separate diffs
2016-01-08ANSIfy gomoku(6) and change a char* to u_char*mestre
OK tb@
2016-01-08ANSIfy sail(6) plus some cleanupmestre
OK tb@
2016-01-08Headers clean upmestre
2016-01-08Remove unnecessary headers an sortmestre
2016-01-08Straightforward headers cleanupmestre
2016-01-08ANSIfy monop(6)mestre
OK tb@
2016-01-08Headers cleanup and removal where suitablemestre
OK tb@
2016-01-08ANSIfy mille(6)mestre
OK tb@
2016-01-08Headers cleanup and also the following:mestre
mille.h: #define CTRL locally, which is used by move.c and misc.c, to avoid including termios.h or sys/ttydefaults.h where it's actually defined varpush.c: Change _PATH_DEVNULL to "/dev/null" since other systems may not have it defined but also avoids including <paths.h> Included a few sugestions from tb@ who also gave his OK
2016-01-08add missing 'void'tb
ok mestre@
2016-01-08Structural integrity hasn't improved in over twenty years.tb
ok mestre@
2016-01-07ANSIfy hunt(6)mestre
Note: casted 2 args to struct sockaddr * on list.c to shut off compiler warnings, and also changed an int len to socklen_t since recvfrom(2) receives the last argument as the latter. I'm running out of credits, but this was once again with great help and OK from tb@
2016-01-07Headers cleanup and sortingmestre
OK tb@
2016-01-07hack expects to be able to read ^Z as a normal character so disableTodd C. Miller
SUSP in the termios settings. Presumably this is how things worked before the conversion to termios. Fixes suspend/resume in hack.
2016-01-07Some basic code maintenance in games/tb
- in main() replace exit with return - drop some /* NOTREACHED */ lint comments along the way. - make more use of standard CFLAGS, esp. -Wimplicit-function-declaration - add and sort some headers when needed - add straightforward pledges to some programs used at compile time discussed with and ok mestre@
2016-01-07ANSIfy trek(6)mestre
Note: Binary change is introduced due to function schedule() where its args are (int,double,char,char,char), but on trek.h are (int,double,int,int,int). Changed to the latter since the 3 last args are coordinates. OK tb@