Home | History | Annotate | only in /src/games/tetris
History log of /src/games/tetris
RevisionDateAuthorComments
 1.10 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.9 06-Sep-2020  mrg apply ${GCC_NO_FORMAT_TRUNCATION} to scores.c
 1.8 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.7 03-Feb-2010  roy branches: 1.7.46;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@
 1.6 28-Jan-2008  dholland 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.
 1.5 28-Jan-2008  dholland Build with WARNS=4. (All fixes are cosmetic, except that it's definitely
bad karma to shadow a local variable with another of the same name in a
nested block...)
 1.4 20-Nov-1997  mrg install games that need it setgid.
 1.3 22-Apr-1995  cgd branches: 1.3.4;
NetBSD RCS Ids
 1.2 22-Dec-1994  cgd specify man pages the new way.
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.3.4.1 20-Nov-1997  mrg pull up from trunk:
- install games files with the correct permissions.
- install games that need it setgid.
 1.7.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.11 25-May-2009  dholland ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.10 19-Mar-2006  christos Coverity CID 868: Fix possible NULL deref (after INFTIM passes :-)
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.8 29-Dec-2002  kristerw Correct some comments and error messages that still talked about "select".

Solves the last part of PR 18905.
 1.7 26-Dec-2002  jmmv Fix a bug in rwait() introduced during the select() to poll() conversion
that caused tetris to crash when pausing the game. Approved by tron.
 1.6 19-Sep-2002  mycroft select() -> poll()
 1.5 02-Jun-2002  wiz de-register
 1.4 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.3 06-Feb-1996  jtc Removed "extern int errno"; Added #include <errno.h> if not already present.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.5 27-Jan-2004  jsm Remove uses of __P.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.3 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.26 02-May-2021  rillig games: remove trailing whitespace in *.c and *.h
 1.25 07-Sep-2020  mrg avoid uninit memory and use memmove vs strncpy for a will be
truncated on purpose string.
 1.24 24-Jun-2018  mrg fix the previous. the code was right, just badly formatted before.

should fix infinite loops reported in some cases.
 1.23 04-Feb-2018  mrg branches: 1.23.2;
fix issues found by GCC 6.4:

battlestar was missing some {} in its insane printf()+puts() usage.
this is a literal code sequence i found:

printf("The blast catches ");
printf("the goddess in the ");
printf("stomach, knocking ");
puts("her to the ground.");
printf("She writhes in the ");
printf("dirt as the agony of ");
puts("death taunts her.");
puts("She has stopped moving.");

no lines inserted or removed.

tetris' checkscores() had wrong and missing {} usage.
 1.22 22-Mar-2014  dholland Revert part of previous -r1.21 and fix the errno-handling bug instead.
 1.21 19-Oct-2013  christos fix unused variable warnings
 1.20 05-Jan-2011  wiz branches: 1.20.6; 1.20.12;
Fix fd leak in error cases. Found by cppcheck.
 1.19 03-Feb-2010  roy Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@
 1.18 08-Sep-2009  dholland Disable writing scores when built for /rescue. PR 42009
 1.17 01-Jun-2009  dholland Don't use a variable-size array here. There's not really that much point.
 1.16 25-May-2009  dholland Clean up scorefile handling.

This was writing time_t to disk. Worse, the time_t member was at an
unaligned offset in the structure in question, so after the time_t
change the structure layout depended on compiler-inserted structure
padding. This gives three legacy formats: one with 32-bit time, one
with 64-bit time, and one with 64-bit time and 4 bytes of structure
padding.

And of course the file didn't have a header or version coding or
anything.

The new code writes a structure of well-defined size that should not
receive unexpected padding, and gives the file a header and version
number. It reads that format and any of the three legacy formats,
figuring out which one it's dealing with by inspecting the file
contents. For good measure, it also now handles opposite-endian files,
doesn't bail out unceremoniously unless necessary, and won't croak if
the file is corrupt and e.g. contains unterminated strings.

(Was it worth going to this length? Maybe not. But it didn't seem
right to just leave it, and it's not clear where to stop halfway.)
 1.15 25-May-2009  dholland ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.14 01-Jun-2006  drochner Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.13 27-Jan-2004  jsm branches: 1.13.2; 1.13.4; 1.13.6; 1.13.8; 1.13.10;
Remove uses of __P.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.11 02-Jun-2002  wiz de-register
 1.10 21-Jan-2000  jsm Clean up error reporting in tetris.
 1.9 21-Jan-2000  jsm Fix high score table formatting bug.

Bug report and fix from Malcolm Parsons <malcolm@bits.bris.ac.uk>.
 1.8 18-Sep-1999  jsm Fix -Wsign-compare warnings.
 1.7 17-Sep-1999  jsm Convert tetris to use <err.h> functions.
 1.6 12-Sep-1999  jsm Security improvements for games (largely from or inspired by OpenBSD).

Games which run setgid from dm, but don't need to, should drop their
privileges at startup.

Games which have a scorefile should open it at startup, then drop all
privileges leaving just the open writable file descriptor. If the
game can invoke subprocesses, this should be made close-on-exec.

Games with scorefiles should make sure they do not get a file
descriptor < 3. (Otherwise, they could get confused and corrupt the
scorefile when using stdin, stdout or stderr.)

Some old setuid revokes from the days of setuid games change into gid
revokes.
 1.5 08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.4 14-Oct-1997  lukem use <termcap.h>
 1.3 13-Jan-1997  tls bfunctions -> memfunctions
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.13.10.1 08-Jun-2006  tron Pull up following revision(s) (requested by dan in ticket #1368):
games/tetris/scores.c: revision 1.14
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.13.8.1 08-Jun-2006  tron Pull up following revision(s) (requested by dan in ticket #10641):
games/tetris/scores.c: revision 1.14
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.13.6.1 08-Jun-2006  tron Pull up following revision(s) (requested by dan in ticket #1368):
games/tetris/scores.c: revision 1.14
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.13.4.1 08-Jun-2006  tron Pull up following revision(s) (requested by dan in ticket #10641):
games/tetris/scores.c: revision 1.14
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.13.2.1 08-Jun-2006  tron Pull up following revision(s) (requested by dan in ticket #10641):
games/tetris/scores.c: revision 1.14
Better check data read from tetris.scores before use as array indices etc.
This is CVE-2006-1539, files against Gentoo Linux, the patch is from
Gentoo.
A standard NetBSD installation is not as much risk because tetris is
sgid "games", and users shouldn't be in that group.
 1.20.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.23.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 25-May-2009  dholland Clean up scorefile handling.

This was writing time_t to disk. Worse, the time_t member was at an
unaligned offset in the structure in question, so after the time_t
change the structure layout depended on compiler-inserted structure
padding. This gives three legacy formats: one with 32-bit time, one
with 64-bit time, and one with 64-bit time and 4 bytes of structure
padding.

And of course the file didn't have a header or version coding or
anything.

The new code writes a structure of well-defined size that should not
receive unexpected padding, and gives the file a header and version
number. It reads that format and any of the three legacy formats,
figuring out which one it's dealing with by inspecting the file
contents. For good measure, it also now handles opposite-endian files,
doesn't bail out unceremoniously unless necessary, and won't croak if
the file is corrupt and e.g. contains unterminated strings.

(Was it worth going to this length? Maybe not. But it didn't seem
right to just leave it, and it's not clear where to stop halfway.)
 1.4 27-Jan-2004  jsm Remove uses of __P.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.34 02-May-2021  rillig games: remove trailing whitespace in *.c and *.h
 1.33 20-Mar-2017  christos elide compiler stupidity.
 1.32 03-Mar-2016  nat branches: 1.32.2; 1.32.4;
Center game board on screen. OK from christos@.
 1.31 06-Nov-2015  christos PR/50411: Rin Okuyama: fix two bugs:
- clear blocks in the 0 row, otherwise the pile up forever.
- black (white) blocks are not shown as "next shape":
 1.30 07-Jul-2015  nat Fixes color scheme white on black and black on white.

This commit was approved by christos@
 1.29 13-Jul-2014  pgoyette branches: 1.29.2;
Provide an option to restore traditional black-and-white mode.
 1.28 11-Jun-2014  christos Add a little color. In order to minimize logic differences, keep 0 as the
empty board value, and since 7 is white, turn white into black (0) when
painting.
 1.27 03-Oct-2011  roy branches: 1.27.8; 1.27.18;
Use tiparm instead of vtparm.
 1.26 03-Feb-2010  roy Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@
 1.25 19-Dec-2009  ahoka Hide the cursor during the game.
 1.24 12-Aug-2009  dholland sprinkle static
 1.23 25-May-2009  dholland ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.22 28-Jan-2008  dholland Build with WARNS=4. (All fixes are cosmetic, except that it's definitely
bad karma to shadow a local variable with another of the same name in a
nested block...)
 1.21 15-Dec-2007  perry convert __attribute__s to applicable cdefs.h macros
 1.20 15-Dec-2007  perry include sys/cdefs.h so that __attribute__ can be fixed later
 1.19 27-Jan-2004  jsm branches: 1.19.22;
Remove uses of __P.
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.17 02-Jun-2002  wiz de-register
 1.16 02-Nov-2001  christos Update to the new t_agetstr() API.
 1.15 24-May-2000  blymn Fix core dump.
 1.14 22-May-2000  blymn Converted games to use the new termcap interface.
 1.13 04-Oct-1999  lukem update after change to return value of tputs() third argument
 1.12 08-Sep-1999  jsm branches: 1.12.2;
Add `__noreturn__' and `__unused__' attributes where appropriate to
the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Most noreturn attributes were previously added in bin/6144, with some
others that were missed then in bin/8082. Previous `unused'
attributes were covered in bin/6557, bin/8058 and other PRs (all these
PRs have already been handled and closed).
 1.11 08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.10 14-Aug-1999  tron Adapt to change of "termcap.h".
 1.9 03-Jan-1999  hubertf only show preview if the -p option is given
 1.8 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.7 10-Aug-1998  perry bzero->memset
 1.6 14-Oct-1997  lukem use <termcap.h>
 1.5 12-Oct-1997  lukem minor WARNSify
 1.4 29-Apr-1995  mycroft Fix usages of ospeed.
 1.3 28-Apr-1995  mycroft Use POSIX signal and tty semantics.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.12.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.22.2 23-Mar-2008  matt sync with HEAD
 1.19.22.1 09-Jan-2008  matt sync with HEAD
 1.27.18.1 10-Aug-2014  tls Rebase.
 1.27.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.2.1 17-Jul-2015  snj Pull up following revision(s) (requested by nat in ticket #873):
games/tetris/screen.c: revision 1.30
Fixes color scheme white on black and black on white.
This commit was approved by christos@
 1.32.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.32.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.9 12-Aug-2009  dholland sprinkle static
 1.8 27-Jan-2004  jsm Remove uses of __P.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.6 22-May-2000  blymn Converted games to use the new termcap interface.
 1.5 01-Jan-2000  jsm Declare variables as extern in headers rather than using linker commons.
 1.4 04-Oct-1999  lukem update after change to return value of tputs() third argument
 1.3 14-Oct-1997  lukem branches: 1.3.6;
use <termcap.h>
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9 11-Jun-2014  christos Add a little color. In order to minimize logic differences, keep 0 as the
empty board value, and since 7 is white, turn white into black (0) when
painting.
 1.8 25-May-2009  dholland branches: 1.8.12; 1.8.22;
ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.7 22-Oct-2006  mrg don't discard const. GCC 4.1-20061021 doesn't like that...
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.5 02-Jun-2002  wiz de-register
 1.4 08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.3 12-Oct-1997  lukem minor WARNSify
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.8.22.1 10-Aug-2014  tls Rebase.
 1.8.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18 01-Jul-2023  nia tetris(6): Support the informal standard of allowing setting NO_COLOR
in the environment to disable the use of color. (no-color.org)
 1.17 12-Mar-2016  dholland tetris(6) is not limited to CRT displays. noted by tnn
 1.16 19-Feb-2015  wiz Use Pp (mdoc) instead of sp (roff).
Use An in AUTHORS section.
 1.15 19-Feb-2015  mrg add a 'down' key to tetris, defaulting to 'n'. it move the block down
a line, if it fits. like most other tetris games have.

minor clean up of magic number usage while here.
 1.14 15-Jul-2014  wiz branches: 1.14.2;
Bump date for -c (exactly one year after previous bump)
 1.13 13-Jul-2014  pgoyette At suggestion of christos@, use -b for b&w rather than -c
 1.12 13-Jul-2014  pgoyette Provide an option to restore traditional black-and-white mode.
 1.11 15-Sep-2005  wiz branches: 1.11.48; 1.11.60;
Use standard AUTHORS section header. From YOMURA Masanori in private mail
Sort sections if necessary. Use more/better markup.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.9 26-Sep-2002  wiz Lots of minor fixes resulting from reading these man pages in detail.
 1.8 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.7 02-Apr-2001  wiz Whitespace and/or punctuation fixes.
 1.6 03-Jan-1999  hubertf only show preview if the -p option is given
 1.5 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.4 01-Sep-1997  mikel fix typo; from Hubert Feyrer in PR bin/4070
 1.3 29-May-1997  cgd Fix broken uses of Dd. Both the mdoc and mdoc.samples pages agree:
.Dd is supposed to be invoked like:
.Dd month day, year
e.g. ".Dd January 25, 1989", rather than:
.Dd "month day, year"
which is what these pages did.
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.11.60.1 10-Aug-2014  tls Rebase.
 1.11.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.2.1 18-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #622):
games/tetris/tetris.6: revision 1.15
games/tetris/tetris.c: revision 1.28
add a 'down' key to tetris, defaulting to 'n'. it move the block down
a line, if it fits. like most other tetris games have.
minor clean up of magic number usage while here.
 1.34 01-Jul-2023  nia tetris(6): Support the informal standard of allowing setting NO_COLOR
in the environment to disable the use of color. (no-color.org)
 1.33 21-Jul-2020  nia tetris: Use arc4random_uniform instead of modulo for better randomness
 1.32 03-Mar-2016  nat Center game board on screen. OK from christos@.
 1.31 06-Nov-2015  christos PR/50411: Rin Okuyama: fix two bugs:
- clear blocks in the 0 row, otherwise the pile up forever.
- black (white) blocks are not shown as "next shape":
 1.30 13-Jun-2015  dholland add -b to usage, from leot
 1.29 13-Jun-2015  dholland Fix the list of keys across the bottom so it fits on an 80-column screen
again. Fixes PR 49937.

HI MRG
 1.28 19-Feb-2015  mrg add a 'down' key to tetris, defaulting to 'n'. it move the block down
a line, if it fits. like most other tetris games have.

minor clean up of magic number usage while here.
 1.27 13-Jul-2014  pgoyette branches: 1.27.2;
At suggestion of christos@, use -b for b&w rather than -c
 1.26 13-Jul-2014  pgoyette Provide an option to restore traditional black-and-white mode.
 1.25 11-Jun-2014  christos Add a little color. In order to minimize logic differences, keep 0 as the
empty board value, and since 7 is white, turn white into black (0) when
painting.
 1.24 31-Aug-2011  plunky branches: 1.24.8; 1.24.18;
NULL does not need a cast
 1.23 05-Dec-2010  pgoyette Fix a few of the games to use getprogname() in their usage() functions.

Suggested by Joerg.

XXX There are probably many more that have their progname hard-coded, but
XXX I'm not up for a wholesale roto-till at the moment.
 1.22 12-Aug-2009  dholland sprinkle static
 1.21 25-May-2009  dholland ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.20 25-May-2009  dholland sprintf -> snprintf
 1.19 20-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
 1.18 15-Dec-2007  perry branches: 1.18.6;
convert __attribute__s to applicable cdefs.h macros
 1.17 27-Jan-2004  jsm branches: 1.17.22;
Remove uses of __P.
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.15 02-Jun-2002  wiz de-register
 1.14 21-Jan-2000  jsm Clean up error reporting in tetris.
 1.13 01-Jan-2000  jsm Declare variables as extern in headers rather than using linker commons.
 1.12 12-Sep-1999  jsm Security improvements for games (largely from or inspired by OpenBSD).

Games which run setgid from dm, but don't need to, should drop their
privileges at startup.

Games which have a scorefile should open it at startup, then drop all
privileges leaving just the open writable file descriptor. If the
game can invoke subprocesses, this should be made close-on-exec.

Games with scorefiles should make sure they do not get a file
descriptor < 3. (Otherwise, they could get confused and corrupt the
scorefile when using stdin, stdout or stderr.)

Some old setuid revokes from the days of setuid games change into gid
revokes.
 1.11 08-Sep-1999  jsm Add `__noreturn__' and `__unused__' attributes where appropriate to
the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Most noreturn attributes were previously added in bin/6144, with some
others that were missed then in bin/8082. Previous `unused'
attributes were covered in bin/6557, bin/8058 and other PRs (all these
PRs have already been handled and closed).
 1.10 08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.9 22-Mar-1999  abs Newline and usage cosmetics from Soren S. Jorvang <soren@t.dk> PR7205
 1.8 11-Feb-1999  simonb Remove unneeded "mips compiler bug" workaround from original code imported
in 1994.
 1.7 03-Jan-1999  hubertf only show preview if the -p option is given
 1.6 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.5 13-Sep-1998  hubertf mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>)
 1.4 10-Aug-1998  perry bzero->memset
 1.3 12-Oct-1997  lukem minor WARNSify
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.17.22.1 09-Jan-2008  matt sync with HEAD
 1.18.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.18.1 10-Aug-2014  tls Rebase.
 1.24.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.2.1 18-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #622):
games/tetris/tetris.6: revision 1.15
games/tetris/tetris.c: revision 1.28
add a 'down' key to tetris, defaulting to 'n'. it move the block down
a line, if it fits. like most other tetris games have.
minor clean up of magic number usage while here.
 1.16 21-Jul-2020  nia tetris: Use arc4random_uniform instead of modulo for better randomness
 1.15 03-Mar-2016  nat Center game board on screen. OK from christos@.
 1.14 13-Jul-2014  pgoyette Provide an option to restore traditional black-and-white mode.
 1.13 11-Jun-2014  christos Add a little color. In order to minimize logic differences, keep 0 as the
empty board value, and since 7 is white, turn white into black (0) when
painting.
 1.12 12-Aug-2009  dholland branches: 1.12.12; 1.12.22;
sprinkle static
 1.11 25-May-2009  dholland ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
 1.10 27-Jan-2004  jsm Remove uses of __P.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.8 01-Jan-2000  jsm Declare variables as extern in headers rather than using linker commons.
 1.7 12-Sep-1999  jsm Security improvements for games (largely from or inspired by OpenBSD).

Games which run setgid from dm, but don't need to, should drop their
privileges at startup.

Games which have a scorefile should open it at startup, then drop all
privileges leaving just the open writable file descriptor. If the
game can invoke subprocesses, this should be made close-on-exec.

Games with scorefiles should make sure they do not get a file
descriptor < 3. (Otherwise, they could get confused and corrupt the
scorefile when using stdin, stdout or stderr.)

Some old setuid revokes from the days of setuid games change into gid
revokes.
 1.6 08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.5 03-Jan-1999  hubertf only show preview if the -p option is given
 1.4 03-Jan-1999  hubertf Add previewing of next shape. Old (previous) behaviour can be
restored by compiling with NO_PREVIEW defined.
 1.3 13-Sep-1998  hubertf mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>)
 1.2 22-Apr-1995  cgd NetBSD RCS Ids
 1.1 06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 06-May-1994  cgd ascii tetris!
 1.12.22.1 10-Aug-2014  tls Rebase.
 1.12.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.

RSS XML Feed