Fix prototypes. Regenerate patches as unified diffs.

This commit is contained in:
joerg 2013-01-15 15:19:05 +00:00
parent 1d0c52a6ad
commit 864a6d5515
21 changed files with 349 additions and 243 deletions

View file

@ -1,15 +1,18 @@
$NetBSD: distinfo,v 1.4 2010/01/31 21:45:30 joerg Exp $
$NetBSD: distinfo,v 1.5 2013/01/15 15:19:05 joerg Exp $
SHA1 (jetpack.tar.Z) = 7898a971eed7a03e9e390c83d0365584f74dabc7
RMD160 (jetpack.tar.Z) = 2454cef72849f8f644ac6600ad84b3bebd39f8cf
Size (jetpack.tar.Z) = 70621 bytes
SHA1 (patch-aa) = f601182dd4e08eeacddc1a25775de0a3c5e264f1
SHA1 (patch-ab) = 206f2b078e4539950bb497e378e121f8692fec2a
SHA1 (patch-ac) = ea31ff1e6a8f3e8162178a1f2f156bc06550873e
SHA1 (patch-ad) = f64494ec70fade9d203ab8dbc2795b94f9ecb7e7
SHA1 (patch-ae) = ab6e97d8115912bbf58dbcc9aa1a7f3b4c8e61ae
SHA1 (patch-af) = 18001768aed8d316622041ccce2bb07fca7b0e29
SHA1 (patch-ag) = 580c3d4d4064f93a16342d54dc51f039d9cb2d63
SHA1 (patch-ah) = 4c67dbabe2eb4771087d987da3ef7828dbad34b5
SHA1 (patch-ai) = ee23f0fadeb1885a9e7f4a63c929825c432276c8
SHA1 (patch-aj) = a45cd31d6fe3987f63c4017b6c145ae197407d05
SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-main.c) = SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-message.c) = SHA1 (patch-main.c) = SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-scores.c) = SHA1 (patch-message.c) = SHA1 (patch-main.c) = SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-setup.c) = SHA1 (patch-scores.c) = SHA1 (patch-message.c) = SHA1 (patch-main.c) = SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb
SHA1 (patch-update.c) = SHA1 (patch-setup.c) = SHA1 (patch-scores.c) = SHA1 (patch-message.c) = SHA1 (patch-main.c) = SHA1 (patch-gameover.c) = SHA1 (patch-events.c) = SHA1 (patch-erase.c) = SHA1 (patch-draw.c) = SHA1 (patch-demo.c) = SHA1 (patch-defs.h) = SHA1 (patch-ad) = SHA1 (patch-ac) = SHA1 (patch-update.c) = b82cfbc0955ce40d51904f2885afa809493645fb

View file

@ -1,43 +0,0 @@
$NetBSD: patch-aa,v 1.1 1998/08/23 11:24:53 garbled Exp $
*** erase.c.orig Wed Mar 25 17:19:41 1992
--- erase.c Thu Mar 26 11:19:35 1992
***************
*** 11,16 ****
--- 11,17 ----
#ifndef BLIT
+ #define MAXTOUCH 10
#define MAXOBJECTS 6+MAXLINES+MAXFIREBALLS+MAXSWEEPERS+MAXFUELPODS+MAXGUARDS+MAXHIGHSCORES/5
/* Structure for eraseable zones that minimize flicker
***************
*** 19,25 ****
int type, num;
int x, y, w, h;
int numtouch;
! int touch[MAXOBJECTS];
int erased, drawn;
};
--- 20,26 ----
int type, num;
int x, y, w, h;
int numtouch;
! int touch[MAXTOUCH];
int erased, drawn;
};
***************
*** 57,62 ****
--- 58,67 ----
if(zone_intersect(numzones,j)) {
zones[j].touch[zones[j].numtouch] = numzones;
zones[j].numtouch++;
+ if (zones[j].numtouch == MAXTOUCH) {
+ zones[j].numtouch = -1;
+ printf("Reached maxtouch for zone %d\n", numzones);
+ }
break;
}
}

View file

@ -1,24 +0,0 @@
$NetBSD: patch-ab,v 1.1 1998/08/23 11:24:53 garbled Exp $
*** defs.h.orig Tue Sep 20 01:12:40 1994
--- defs.h Tue Sep 20 01:13:15 1994
***************
*** 310,318 ****
#define BONUSINCREMENT 10
#define BONUSTIME 20
#define EXTRAMANSCORE 10000
! #define USECDELAY 45000
! extern int men, score, bonus, bonustimer, initbonus, level;
oldscore, oldlevel, extramaninc;
/* game state
--- 310,318 ----
#define BONUSINCREMENT 10
#define BONUSTIME 20
#define EXTRAMANSCORE 10000
! #define USECDELAY 35000
! extern int men, score, bonus, bonustimer, initbonus, level,
oldscore, oldlevel, extramaninc;
/* game state

View file

@ -1,4 +1,5 @@
$NetBSD: patch-ac,v 1.3 2010/01/31 21:45:30 joerg Exp $
$NetBSD: patch-ac,v 1.4 2013/01/15 15:19:05 joerg Exp $
--- Imakefile.orig Sun Mar 29 12:41:25 1992
+++ Imakefile Sun Sep 13 15:08:51 1998
@@ -1,54 +1,53 @@

View file

@ -1,27 +0,0 @@
$NetBSD: patch-ae,v 1.1 1998/08/23 11:24:53 garbled Exp $
*** main.c.orig Mon Apr 6 12:59:32 1992
--- main.c Thu Sep 22 13:07:12 1994
***************
*** 1,5 ****
--- 1,9 ----
/* main.c : main loop of jetpack
*/
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
#include "copyright.h"
#include "defs.h"
***************
*** 18,23 ****
--- 22,30 ----
int seed;
char lev[20];
register unsigned long timer;
+ struct rlimit l = {0, 0};
+
+ setrlimit(RLIMIT_CORE, &l);
/* randomize the random number generator by seeding it with the time
in seconds

View file

@ -1,20 +0,0 @@
$NetBSD: patch-af,v 1.1 1998/08/23 11:24:54 garbled Exp $
*** scores.c~ Mon Nov 8 15:15:55 1993
--- scores.c Sat Nov 19 22:32:31 1994
***************
*** 35,41 ****
numhighs = 0;
scorefd = open(SCOREPATH, O_RDWR);
if(scorefd == -1) {
! scorefd = open(SCOREPATH, O_RDWR | O_CREAT, 0444);
if(scorefd == -1) {
scorefd = open("jetpack.scores", O_RDWR);
if(scorefd == -1) {
--- 35,41 ----
numhighs = 0;
scorefd = open(SCOREPATH, O_RDWR);
if(scorefd == -1) {
! scorefd = open(SCOREPATH, O_RDWR | O_CREAT, 0644);
if(scorefd == -1) {
scorefd = open("jetpack.scores", O_RDWR);
if(scorefd == -1) {

View file

@ -1,10 +0,0 @@
$NetBSD: patch-ag,v 1.1 1998/08/23 11:24:54 garbled Exp $
*** defs.h~ Sun Feb 12 17:34:08 1995
--- defs.h Sun Feb 12 17:34:46 1995
***************
*** 319,321 ****
--- 319,322 ----
*/
extern int paused, leveldone, gameover, lastscore;
+ extern int usecdelay;

View file

@ -1,20 +0,0 @@
$NetBSD: patch-ah,v 1.1 1998/08/23 11:24:54 garbled Exp $
*** draw.c~ Mon Nov 8 15:15:54 1993
--- draw.c Sun Feb 12 17:34:39 1995
***************
*** 533,539 ****
y, CGREY, fontinfo);
y += fontinfo->descent + fontinfo->ascent;
place_string(
! " center button : fire jetpack ",
y, CYELLOW, fontinfo);
y += fontinfo->descent + 10 + fontinfo->ascent;
place_string("Extra Player awarded every 10000 points", y, CGREY,
--- 533,539 ----
y, CGREY, fontinfo);
y += fontinfo->descent + fontinfo->ascent;
place_string(
! " center button : fire jetpack T : turbo ",
y, CYELLOW, fontinfo);
y += fontinfo->descent + 10 + fontinfo->ascent;
place_string("Extra Player awarded every 10000 points", y, CGREY,

View file

@ -1,50 +0,0 @@
$NetBSD: patch-ai,v 1.1 1998/08/23 11:24:54 garbled Exp $
*** events.c~ Mon Nov 8 15:16:07 1993
--- events.c Sun Feb 12 17:34:55 1995
***************
*** 4,9 ****
--- 4,11 ----
#include "copyright.h"
#include "defs.h"
+ int usecdelay = USECDELAY;
+
/* event_filter handles game events
*/
int event_filter()
***************
*** 86,91 ****
--- 88,100 ----
XLookupString(event, &buf, 1, &key, &i);
switch(key) {
+ case 't':
+ case 'T':
+ if (usecdelay == USECDELAY)
+ usecdelay = USECDELAY/1.5;
+ else
+ usecdelay = USECDELAY;
+ break;
case XK_KP_4:
case 'a':
case 'A':
***************
*** 115,120 ****
--- 124,130 ----
}
break;
case 'Q':
+ case 'q':
if(dead) break;
dead = 1;
deadtimer = 50;
***************
*** 124,129 ****
--- 134,140 ----
dumb_message(MQUIT);
break;
case 'p':
+ case 'P':
if(paused) {
paused = 0;
bigmessagetime = 0;

View file

@ -1,37 +0,0 @@
$NetBSD: patch-aj,v 1.1 1998/08/23 11:24:54 garbled Exp $
*** main.c~ Sun Feb 12 17:34:09 1995
--- main.c Sun Feb 12 17:34:29 1995
***************
*** 90,96 ****
begin_timer();
while(paused) {
while(XPending(display) && !event_filter());
! usleep(USECDELAY);
}
while(XPending(display) && !event_filter());
update();
--- 90,96 ----
begin_timer();
while(paused) {
while(XPending(display) && !event_filter());
! usleep(usecdelay);
}
while(XPending(display) && !event_filter());
update();
***************
*** 111,117 ****
busy, and you shouldn't be playing anyway.
*/
timer = get_timer();
! if(timer < USECDELAY) usleep(USECDELAY - timer);
}
}
}
--- 111,117 ----
busy, and you shouldn't be playing anyway.
*/
timer = get_timer();
! if(timer < usecdelay) usleep(usecdelay - timer);
}
}
}

View file

@ -0,0 +1,27 @@
$NetBSD: patch-defs.h,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- defs.h.orig 2013-01-14 16:27:35.000000000 +0000
+++ defs.h
@@ -135,6 +135,8 @@ extern int xdir[4], ydir[4];
#define MEXIT 5
#define MQUIT 6
+void dumb_message(int kind);
+
/* Structure used to store the messages triggered in certain areas of a
level
*/
@@ -319,3 +321,13 @@ extern int men, score, bonus, bonustimer
*/
extern int paused, leveldone, gameover, lastscore;
+extern int usecdelay;
+
+void death(void);
+void demo(void);
+void check_score(void);
+void open_scores(void);
+void place_fuel(int x, int y);
+void place_sweeper(int x, int y, int floor, int rot, int speed);
+void place_guard(int x, int y, int dir, int speed);
+void place_fireball(int x, int y, int dx, int dy);

View file

@ -0,0 +1,13 @@
$NetBSD: patch-demo.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- demo.c.orig 2013-01-14 16:34:45.000000000 +0000
+++ demo.c
@@ -13,7 +13,7 @@ int demostage, demodelay;
the demo, and demo_player does the actual player action. The level
itself is special level 0.
*/
-demo()
+void demo(void)
{
register unsigned long timer;

View file

@ -0,0 +1,31 @@
$NetBSD: patch-draw.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- draw.c.orig 1992-03-29 19:41:14.000000000 +0000
+++ draw.c
@@ -4,6 +4,8 @@
#include "copyright.h"
#include "defs.h"
+static void draw_player(void);
+
Pixmap drawpixmap;
char fuelstring[20] = "Fuel: ";
@@ -68,7 +70,7 @@ draw_maze()
/* draw_player draws the player in the center of the window
*/
-draw_player()
+static void draw_player(void)
{
if(dead) return;
if(exploded > -1) {
@@ -533,7 +535,7 @@ title_refresh()
y, CGREY, fontinfo);
y += fontinfo->descent + fontinfo->ascent;
place_string(
- " center button : fire jetpack ",
+ " center button : fire jetpack T : turbo ",
y, CYELLOW, fontinfo);
y += fontinfo->descent + 10 + fontinfo->ascent;
place_string("Extra Player awarded every 10000 points", y, CGREY,

View file

@ -0,0 +1,57 @@
$NetBSD: patch-erase.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- erase.c.orig 1992-03-29 19:41:20.000000000 +0000
+++ erase.c
@@ -8,9 +8,12 @@
/* Note: the functions and variables in this file are not used in the
blitting version.
*/
+static void draw_recur(int i);
+static void erase_recur(int i);
#ifndef BLIT
+#define MAXTOUCH 10
#define MAXOBJECTS 6+MAXLINES+MAXFIREBALLS+MAXSWEEPERS+MAXFUELPODS+MAXGUARDS+MAXHIGHSCORES/5
/* Structure for eraseable zones that minimize flicker
@@ -19,7 +22,7 @@ struct zone {
int type, num;
int x, y, w, h;
int numtouch;
- int touch[MAXOBJECTS];
+ int touch[MAXTOUCH];
int erased, drawn;
};
@@ -57,6 +60,10 @@ int x, y, w, h, type, num;
if(zone_intersect(numzones,j)) {
zones[j].touch[zones[j].numtouch] = numzones;
zones[j].numtouch++;
+ if (zones[j].numtouch == MAXTOUCH) {
+ zones[j].numtouch = -1;
+ printf("Reached maxtouch for zone %d\n", numzones);
+ }
break;
}
}
@@ -115,8 +122,7 @@ erase_draw_zones()
/* erase_recur erases zone i and all the zones that touch it.
*/
-erase_recur(i)
-int i;
+static void erase_recur(int i)
{
register int j;
@@ -137,8 +143,7 @@ int i;
/* draw_recur draws the object associated with zone i and the objects
associated with all the zones that touch it.
*/
-draw_recur(i)
-int i;
+static void draw_recur(int i)
{
register int j, tmp;

View file

@ -0,0 +1,43 @@
$NetBSD: patch-events.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- events.c.orig 1992-03-29 19:41:27.000000000 +0000
+++ events.c
@@ -4,6 +4,8 @@
#include "copyright.h"
#include "defs.h"
+int usecdelay = USECDELAY;
+
/* event_filter handles game events
*/
int event_filter()
@@ -86,6 +88,13 @@ XKeyEvent *event;
XLookupString(event, &buf, 1, &key, &i);
switch(key) {
+ case 't':
+ case 'T':
+ if (usecdelay == USECDELAY)
+ usecdelay = USECDELAY/1.5;
+ else
+ usecdelay = USECDELAY;
+ break;
case XK_KP_4:
case 'a':
case 'A':
@@ -115,6 +124,7 @@ XKeyEvent *event;
}
break;
case 'Q':
+ case 'q':
if(dead) break;
dead = 1;
deadtimer = 50;
@@ -124,6 +134,7 @@ XKeyEvent *event;
dumb_message(MQUIT);
break;
case 'p':
+ case 'P':
if(paused) {
paused = 0;
bigmessagetime = 0;

View file

@ -0,0 +1,13 @@
$NetBSD: patch-gameover.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- gameover.c.orig 2013-01-14 16:36:44.000000000 +0000
+++ gameover.c
@@ -8,7 +8,7 @@ int dead, deadtimer;
/* death is called when a player is killed.
*/
-death()
+void death(void)
{
men--;
if(men < 0) {

View file

@ -0,0 +1,22 @@
$NetBSD: patch-main.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- main.c.orig 2013-01-14 16:27:35.000000000 +0000
+++ main.c
@@ -90,7 +90,7 @@ main()
begin_timer();
while(paused) {
while(XPending(display) && !event_filter());
- usleep(USECDELAY);
+ usleep(usecdelay);
}
while(XPending(display) && !event_filter());
update();
@@ -111,7 +111,7 @@ main()
busy, and you shouldn't be playing anyway.
*/
timer = get_timer();
- if(timer < USECDELAY) usleep(USECDELAY - timer);
+ if(timer < usecdelay) usleep(usecdelay - timer);
}
}
}

View file

@ -0,0 +1,14 @@
$NetBSD: patch-message.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- message.c.orig 2013-01-14 16:37:42.000000000 +0000
+++ message.c
@@ -51,8 +51,7 @@ int color, time;
Called dumb because the procedure is ugly and the messages are mostly
snide remarks.
*/
-dumb_message(kind)
-int kind;
+void dumb_message(int kind)
{
register int opinion, num;

View file

@ -0,0 +1,28 @@
$NetBSD: patch-scores.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- scores.c.orig 1992-03-29 19:41:16.000000000 +0000
+++ scores.c
@@ -30,12 +30,12 @@ int dialogwidth, dialogheight;
/* open_scores tries to open the score file, and if it can't it tries to
create one.
*/
-open_scores()
+void open_scores(void)
{
numhighs = 0;
scorefd = open(SCOREPATH, O_RDWR);
if(scorefd == -1) {
- scorefd = open(SCOREPATH, O_RDWR | O_CREAT, 0444);
+ scorefd = open(SCOREPATH, O_RDWR | O_CREAT, 0644);
if(scorefd == -1) {
scorefd = open("jetpack.scores", O_RDWR);
if(scorefd == -1) {
@@ -133,7 +133,7 @@ read_new_scores()
table, and if it makes it, gets the player's name and saves the new
high scores in the file.
*/
-check_score()
+void check_score(void)
{
register int i, spot;
char buf[MAXNAMELENGTH];

View file

@ -0,0 +1,63 @@
$NetBSD: patch-setup.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- setup.c.orig 1992-03-29 19:41:23.000000000 +0000
+++ setup.c
@@ -4,6 +4,8 @@
#include "copyright.h"
#include "defs.h"
+static void random_fuel(int num);
+
/* make_random_level takes its huge list of arguments and creates a
level.
*/
@@ -115,8 +117,7 @@ random_player()
[dx,dy]. The coordinates are modified to so the fireball won't sit on
a wall.
*/
-place_fireball(x, y, dx, dy)
-int x, y, dx, dy;
+void place_fireball(int x, int y, int dx, int dy)
{
if(numfire == MAXFIREBALLS) return;
nx = x;
@@ -161,8 +162,7 @@ int num, min, max;
/* place_guard puts a guard at maze location (x,y) with direction dir and
speed speed
*/
-place_guard(x, y, dir, speed)
-int x, y, dir, speed;
+void place_guard(int x, int y, int dir, int speed)
{
if(numguard == MAXGUARDS) return;
guardx[numguard] = x * mazescale + mazescale / 2;
@@ -205,8 +205,7 @@ int num, min, max;
/* place_sweeper puts a sweeper at maze location (x,y) with a floor
direction of floor, rotation of rot, and speed speed
*/
-place_sweeper(x, y, floor, rot, speed)
-int x, y, floor, rot, speed;
+void place_sweeper(int x, int y, int floor, int rot, int speed)
{
if(numsweep == MAXSWEEPERS) return;
sweepx[numsweep] = x * mazescale + mazescale / 2 + xdir[floor] *
@@ -272,8 +271,7 @@ int num, min, max;
/* place_fuel puts a fuel pod at world location (x,y). The coordinates
are modified so the pod won't sit on a wall.
*/
-place_fuel(x, y)
-int x, y;
+void place_fuel(int x, int y)
{
if(numfuel == MAXFUELPODS) return;
nx = x;
@@ -288,8 +286,7 @@ int x, y;
/* random_fuel places num fuel pods in the maze. The coordinates are
generated so they don't sit on walls or too close together.
*/
-random_fuel(num)
-int num;
+static void random_fuel(int num)
{
register int i, j, ok, radius;

View file

@ -0,0 +1,22 @@
$NetBSD: patch-update.c,v 1.1 2013/01/15 15:19:05 joerg Exp $
--- update.c.orig 2013-01-14 16:42:03.000000000 +0000
+++ update.c
@@ -4,6 +4,8 @@
#include "copyright.h"
#include "defs.h"
+static void update_player(void);
+
int plx, ply, burn, playerphase, playerdir, playervert, playerfuel,
walk, waiting, exploded, explodetimer;
@@ -39,7 +41,7 @@ update()
/* update_player updates the player
*/
-update_player()
+static void update_player(void)
{
register int flags;