Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!daemon From: walton%DEImos.Caltech.Edu@Hamlet.Caltech.Edu Newsgroups: net.micro.amiga Subject: HACK bug fixes Message-ID: <1655@caip.RUTGERS.EDU> Date: Thu, 27-Mar-86 18:48:55 EST Article-I.D.: caip.1655 Posted: Thu Mar 27 18:48:55 1986 Date-Received: Sat, 29-Mar-86 01:31:48 EST Sender: daemon@caip.RUTGERS.EDU Organization: Rutgers Univ., New Brunswick, N.J. Lines: 27 From: walton%DEImos.Caltech.Edu@Hamlet.Caltech.Edu I have been moving HACK to my Aztec C compiler, and found and fixed some bugs. The non-Amiga-specific stuff was thoroughly LINTed, and had no problems. I made the following general changes: (1) Made sure that malloc() was declared as returning char * wherever it was used. (2) Surrounded all references to signal() and with #if UNIX preprocessor statements. (3) Changed structure-valued functions to void-valued, and rewrote them to expect a pointer to a structure as an argument. Aztec C V3.20a doesn't allow functions to return structures by value. A few days ago, someone posted a message to the effect that commenting out FreeDiskObject in hack.icon.c stopped the game from crashing the system when you saved a game. The problem is not in that call, but in the previous one. The line if ( (object = PutDiskObject(name, object)) == NULL) should be if (! PutDiskObject(name, object)) since PutDiskObject returns a short flag (1 for success, 0 for failure) which clobbered the value of the pointer object, which was then handed to FreeDiskObject, causing the crash. Steve Walton ARPA: walton%deimos@hamlet.caltech.edu Caltech Solar Astronomy BITNET:swalton@caltech.bitnet Physics DECNET: DEIMOS::WALTON UUCP: your guess is as good as mine...