jik@athena.mit.edu (Jonathan I. Kamens) (03/02/89)
The patch below to the tetris sources fixes the following problems:
1. Passing a char ** into a function expecting a char *. A typecast
is all that is needed.
2. Numbers that are supposed to be integers (some of which are greater
than 7 -- think about it) being preceded in the sources by a 0.
The 0's are deleted or replaced with spaces.
3. Assigning the return value of getopt() to a char. Changed the char
to an int.
Jonathan Kamens USnail:
MIT Project Athena 410 Memorial Drive, No. 223F
jik@Athena.MIT.EDU Cambridge, MA 02139-4318
Office: 617-253-4261 Home: 617-225-8218
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: tetris_patch
# Wrapped by jik@steve-dallas on Wed Mar 1 19:45:40 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'tetris_patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tetris_patch'\"
else
echo shar: Extracting \"'tetris_patch'\" \(3928 characters\)
sed "s/^X//" >'tetris_patch' <<'END_OF_FILE'
X*** /tmp/,RCSt1001366 Wed Mar 1 19:43:29 1989
X--- csr.c Wed Mar 1 07:26:56 1989
X***************
X*** 47,54 ****
X char *tgetstr();
X char *name;
X
X! tospaces(window0, MAX_Y * MAX_X);
X! tospaces(window1, MAX_Y * MAX_X);
X _csrx = 9000;
X _csry = 9000;
X _rx = 9000;
X--- 47,54 ----
X char *tgetstr();
X char *name;
X
X! tospaces((char *) window0, MAX_Y * MAX_X);
X! tospaces((char *) window1, MAX_Y * MAX_X);
X _csrx = 9000;
X _csry = 9000;
X _rx = 9000;
X*** /tmp/,RCSt1001376 Wed Mar 1 19:43:57 1989
X--- end_game.c Wed Mar 1 06:46:32 1989
X***************
X*** 185,191 ****
X sprintf(aan, "a");
X }
X mvaddstr(8,15,"__________");
X! mvaddstr(09,14,"/ \\");
X mvaddstr(10,13,"/ REST \\");
X mvaddstr(11,12,"/ IN \\");
X mvaddstr(12,11,"/ PEACE \\");
X--- 185,191 ----
X sprintf(aan, "a");
X }
X mvaddstr(8,15,"__________");
X! mvaddstr( 9,14,"/ \\");
X mvaddstr(10,13,"/ REST \\");
X mvaddstr(11,12,"/ IN \\");
X mvaddstr(12,11,"/ PEACE \\");
X*** /tmp/,RCSt1001376 Wed Mar 1 19:44:00 1989
X--- get_level.c Wed Mar 1 06:46:22 1989
X***************
X*** 23,30 ****
X save_screen(5,19,16,62);
X clear(5,19,16,62);
X
X! mvaddstr(05,19, "+-----------------------------------------+");
X! mvaddstr(06,19, "| Starting level: |");
X mvaddstr(15,19, "| [hjkl] to move, [space] to toggle |");
X for(i=7; i<15; i++)
X mvaddstr(i,19,"| |");
X--- 23,30 ----
X save_screen(5,19,16,62);
X clear(5,19,16,62);
X
X! mvaddstr( 5,19, "+-----------------------------------------+");
X! mvaddstr( 6,19, "| Starting level: |");
X mvaddstr(15,19, "| [hjkl] to move, [space] to toggle |");
X for(i=7; i<15; i++)
X mvaddstr(i,19,"| |");
X***************
X*** 31,39 ****
X mvaddstr(11,19, "| Rows of obstacles: |");
X mvaddstr(16,19,"+-----------------------------------------+");
X
X! mvaddstr(07,21,"**** **** **** **** **** **** **** ****");
X! mvaddstr(08,21,"*00* *01* *03* *05* *07* *09* *11* *13*");
X! mvaddstr(09,21,"**** **** **** **** **** **** **** ****");
X
X mvaddstr(12,21,"**** **** **** **** **** **** **** ****");
X mvaddstr(13,21,"*00* *01* *03* *05* *07* *09* *11* *13*");
X--- 31,39 ----
X mvaddstr(11,19, "| Rows of obstacles: |");
X mvaddstr(16,19,"+-----------------------------------------+");
X
X! mvaddstr(7,21,"**** **** **** **** **** **** **** ****");
X! mvaddstr(8,21,"*00* *01* *03* *05* *07* *09* *11* *13*");
X! mvaddstr(9,21,"**** **** **** **** **** **** **** ****");
X
X mvaddstr(12,21,"**** **** **** **** **** **** **** ****");
X mvaddstr(13,21,"*00* *01* *03* *05* *07* *09* *11* *13*");
X*** /tmp/,RCSt1001376 Wed Mar 1 19:44:01 1989
X--- main.c Wed Mar 1 07:01:03 1989
X***************
X*** 38,44 ****
X /* I do a lot of voids, so that lint doesn't complain */
X void init_tetris(), print_shape(), setup_next(), drop_block();
X
X! char c, input; /* holds user's keypresses */
X char tetrisenv[1024];
X char buf[1024];
X int i=0, j=0, k=0, disp_score;
X--- 38,45 ----
X /* I do a lot of voids, so that lint doesn't complain */
X void init_tetris(), print_shape(), setup_next(), drop_block();
X
X! int c;
X! char input; /* holds user's keypresses */
X char tetrisenv[1024];
X char buf[1024];
X int i=0, j=0, k=0, disp_score;
X*** /tmp/,RCSt1001376 Wed Mar 1 19:44:05 1989
X--- useful.c Wed Mar 1 06:54:50 1989
X***************
X*** 40,45 ****
X
X void cont_hand() {
X init_csr();
X! bfill(window0, sizeof(window0), ' ');
X refresh();
X }
X--- 40,45 ----
X
X void cont_hand() {
X init_csr();
X! bfill((char *) window0, sizeof(window0), ' ');
X refresh();
X }
END_OF_FILE
if test 3928 -ne `wc -c <'tetris_patch'`; then
echo shar: \"'tetris_patch'\" unpacked with wrong size!
fi
# end of 'tetris_patch'
fi
echo shar: End of shell archive.
exit 0