games@tekred.CNA.TEK.COM (03/23/89)
Submitted-by: jik@athena.mit.edu (Jonathan I. Kamens) Posting-number: Volume 6, Issue 35 Archive-name: tetris/Patch1 [This has also appeared in th ebugs newsgroup, but I'm passing it on here so it will be archived. -br] [[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. 4. Checking for TETRIS environmant variable existance with a != NULL. 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: Patches01 # Wrapped by billr@saab on Wed Mar 22 14:40:11 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Patches01' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Patches01'\" else echo shar: Extracting \"'Patches01'\" \(3908 characters\) sed "s/^X//" >'Patches01' <<'END_OF_FILE' X*** csr.c.orig Tue Feb 28 12:32:15 1989 X--- csr.c Wed Mar 22 14:37:57 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*** end_game.c.orig Tue Feb 28 12:32:23 1989 X--- end_game.c Wed Mar 22 14:37:57 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*** get_level.c.orig Tue Feb 28 12:32:25 1989 X--- get_level.c Wed Mar 22 14:37:58 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*** main.c.orig Wed Mar 22 14:37:33 1989 X--- main.c Wed Mar 22 14:37:59 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*** useful.c.orig Tue Feb 28 12:32:35 1989 X--- useful.c Wed Mar 22 14:37:59 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 3908 -ne `wc -c <'Patches01'`; then echo shar: \"'Patches01'\" unpacked with wrong size! fi # end of 'Patches01' fi echo shar: End of shell archive. exit 0