[comp.sources.games] v05i098: tess - beyond the tesseract, an abstract adventure game, Patch2

games@tekred.TEK.COM (12/21/88)

Submitted by: Viola lee <viola@idacom.cs.ubc.ca>
Comp.sources.games: Volume 5, Issue 98
Archive-name: tess/Patch2

[If you have an uptodate version of patch, you can feed this article
 to it directly, along with specifing your tess source directory.  -br]

[[Here are a couple of patches to help "tess" compile under UNIX System V.
Basically, they get around the lack of the gettimeofday() call, using
the localtime() call instead.  It also makes it use the better random
number routines in System V.
These patches are courtesy of:
		Dave Yearke, Sigma Systems Technology, Inc.
		   5813 Main St, Williamsville, NY 14221
		          ...!sunybcs!sigmast!dgy]]

#! /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:  patches02
# Wrapped by billr@saab on Tue Dec 20 08:54:37 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches02' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches02'\"
else
echo shar: Extracting \"'patches02'\" \(1619 characters\)
sed "s/^X//" >'patches02' <<'END_OF_FILE'
X*** tess.c.sav	Sat Dec 17 09:00:35 1988
X--- tess.c	Sat Dec 17 09:20:54 1988
X***************
X*** 87,93 ****
X--- 87,98 ----
X  
X  #include "tess-def.c"
X  #include "parser.c"
X+ #ifdef SYSV
X+ #include <sys/types.h>
X+ #include <time.h>
X+ #else /* !SYSV */
X  #include <sys/time.h>
X+ #endif /* !SYSV */
X  
X  
X  /*------------------------------------------------------------*/
X***************
X*** 126,133 ****
X--- 131,143 ----
X  InitAdv()
X  {
X    int i;
X+ #ifdef SYSV
X+   time_t now;
X+   struct tm *tp;
X+ #else /* !SYSV */
X    struct timeval tp;
X    struct timezone tzp;
X+ #endif /* !SYSV */
X  
X    for ( i=1; i<MaxObjs; i++ )
X    {
X***************
X*** 143,155 ****
X--- 153,176 ----
X  
X    zap = cc = wa = ep = dr = af = gp = mi = ti = kp = 0;
X  
X+ #ifdef SYSV
X+   time(&now);
X+   if ((tp = localtime(&now))==NULL) {
X+ #else /* !SYSV */
X    if (gettimeofday(&tp,&tzp)==-1) {
X+ #endif /* !SYSV */
X      perror("gettimeofday");
X      exit(1);
X    }
X+ #ifdef SYSV
X+   (void)srand48 ((long)tp->tm_sec);
X+   for ( sum=0, i=0; i<3; i++ )
X+     sum += (dc [i] = drand48() & 31);
X+ #else /* !SYSV */
X    (void)srand ((int)tp.tv_sec);
X    for ( sum=0, i=0; i<3; i++ )
X      sum += (dc [i] = rand() & 31);
X+ #endif /* !SYSV */
X  
X    print_room = 1;
X  }
X*** Makefile.orig	Tue Nov 29 17:26:32 1988
X--- Makefile	Tue Dec 20 08:52:26 1988
X***************
X*** 1,6 ****
X  # simple makefile for tess
X  
X! CFLAGS = -O
X  
X  tess: tess.c tess-def.c parser.c
X  	cc -o tess $(CFLAGS) tess.c
X--- 1,7 ----
X  # simple makefile for tess
X  
X! DEFINES = #-DSYSV
X! CFLAGS = -O $(DEFINES)
X  
X  tess: tess.c tess-def.c parser.c
X  	cc -o tess $(CFLAGS) tess.c
END_OF_FILE
if test 1619 -ne `wc -c <'patches02'`; then
    echo shar: \"'patches02'\" unpacked with wrong size!
fi
# end of 'patches02'
fi
echo shar: End of shell archive.
exit 0