- Update MASTER_SITES

- Fix build with clang
- Add MAKE_JOBS_SAFE

PR:		175572
Submitted by:	Ports Fury
This commit is contained in:
Martin Wilke 2013-02-04 14:30:02 +00:00
parent 9fe54c4293
commit 5eee5a30c7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=311621
13 changed files with 529 additions and 42 deletions

View File

@ -1,22 +1,21 @@
# New ports collection makefile for: xchomp
# Date created: 4 Jan 1995
# Whom: swallace
#
# Created by: swallace
# $FreeBSD$
#
PORTNAME= xchomp
PORTVERSION= pl1
PORTREVISION= 2
CATEGORIES= games
MASTER_SITES= ftp://ftp.x.org/R5contrib/
MASTER_SITES= XCONTRIB/../R5contrib
MAINTAINER= ports@FreeBSD.org
COMMENT= Pac-man-like game under X11
PLIST_FILES= bin/xchomp
WRKSRC= ${WRKDIR}/xchomp
USE_IMAKE= yes
USE_XORG= x11 xext
USE_IMAKE= yes
MAKE_JOBS_SAFE= yes
PLIST_FILES= bin/xchomp
.include <bsd.port.mk>

View File

@ -1,9 +0,0 @@
--- demo.c.orig Fri Mar 18 06:12:23 1994
+++ demo.c Thu Mar 16 15:45:38 2000
@@ -128,5 +128,5 @@
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if ((last_key == XK_q) || (last_key == XK_Q))
do_exit();

View File

@ -1,9 +0,0 @@
--- main.c.orig Fri Mar 18 06:12:24 1994
+++ main.c Thu Mar 16 15:45:54 2000
@@ -167,5 +167,5 @@
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if (last_key == XK_space)
if (!pause_seq())

View File

@ -1,16 +0,0 @@
--- props.c.orig Fri Mar 18 06:13:17 1994
+++ props.c Thu Mar 16 15:46:08 2000
@@ -116,5 +116,5 @@
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if ((last_key == XK_q) || (last_key == XK_Q))
do_exit();
@@ -176,5 +176,5 @@
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if (last_key == XK_space)
if (!pause_seq())

View File

@ -0,0 +1,29 @@
--- contact.c.orig
+++ contact.c
@@ -17,7 +17,7 @@
* with which the player collided. In this case, it doesn't matter.
*/
/*ARGSUSED*/
-die(dummy)
+void die(dummy)
int dummy;
{
register int xx = pac_x, yy = pac_y, i, dx, dy;
@@ -116,7 +116,7 @@
* of the eaten ghost, and then continues. The parameter is
* the array index of the eaten ghost.
*/
-eat(i)
+void eat(i)
int i;
{
register int xx = pac_x, yy = pac_y, j;
@@ -166,7 +166,7 @@
* The eyes are harmless; this is a no-op.
*/
/*ARGSUSED*/
-noop(dummy)
+void noop(dummy)
int dummy;
{
}

View File

@ -0,0 +1,20 @@
--- demo.c.orig
+++ demo.c
@@ -6,7 +6,7 @@
* for the game.
*/
-demo_seq()
+void demo_seq()
{
int i, xx, yy, direction, ascent, descent, len;
XCharStruct chars;
@@ -127,7 +127,7 @@
if (event.xany.window != window) continue;
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if ((last_key == XK_q) || (last_key == XK_Q))
do_exit();
XFillRectangle(display, window, clearGC, 0, 0, WIN_WIDTH,

View File

@ -0,0 +1,97 @@
--- drivers.c.orig
+++ drivers.c
@@ -12,7 +12,7 @@
* variables (pac_x, pac_y), the direction variables (pac_ix, pac_iy),
* and the clipping region (pac_region).
*/
-control_pac()
+void control_pac()
{
register int xx = pac_x, yy = pac_y, i, dx, dy;
register char *pc = md[yy >> 4] + (xx >> 4);
@@ -89,7 +89,7 @@
* eaten something which is not a ghost -- a dot, a power-dot,
* or the fruit. If so, the appropriate action is taken.
*/
-check_dots()
+void check_dots()
{
register char *pi;
register int i;
@@ -218,7 +218,7 @@
* The function below causes ghosts to follow the player around, with a bit
* of randomness thrown in as well.
*/
-follow(i)
+void follow(i)
register int i;
{
int xx = ghost_x[i], yy = ghost_y[i];
@@ -289,7 +289,7 @@
* at half speed. It is set up as the driver function during
* the ghost-eating periods of the game.
*/
-run(i)
+void run(i)
register int i;
{
int xx = ghost_x[i], yy = ghost_y[i];
@@ -358,7 +358,7 @@
* high speed. It is set up as the driver for ghosts which have
* been eaten.
*/
-go_home(i)
+void go_home(i)
register int i;
{
int xx = ghost_x[i], yy = ghost_y[i];
@@ -459,14 +459,14 @@
* They simply hover around in a circular pattern. Randomness is
* used to decide when the ghosts leave the box.
*/
-hover(i)
+void hover(i)
register int i;
{
register int yy = ghost_y[i] >> 4, xx = ghost_x[i] >> 4;
char *pc = md[yy] + xx;
register int *px = ghost_ix + i, *py = ghost_iy + i;
- if (xx == door_x)
+ if (xx == door_x) {
if (yy == (door_y - 1)) {
/*
@@ -490,6 +490,7 @@
*px = 0, *py = (-2);
return;
}
+ }
/*
* The rest of the function drives the ghost around the
@@ -514,14 +515,14 @@
* the ghost-eating periods of the game -- they move at half
* speed.
*/
-hover2(i)
+void hover2(i)
register int i;
{
register int yy = ghost_y[i] >> 4, xx = ghost_x[i] >> 4;
char *pc = md[yy] + xx;
register int *px = ghost_ix + i, *py = ghost_iy + i;
- if (xx == door_x)
+ if (xx == door_x) {
if (yy == (door_y - 1)) {
drive[i] = run;
run(i);
@@ -532,6 +533,7 @@
*px = 0, *py = (-1);
return;
}
+ }
if (*px > 0) {
if (pc[1]) *px = 0, *py = (-1);

View File

@ -0,0 +1,76 @@
--- main.c.orig
+++ main.c
@@ -2,7 +2,7 @@
#define EXTERN
#include "xchomp.h"
-main(argc, argv)
+int main(argc, argv)
int argc;
char *argv[];
{
@@ -10,6 +10,12 @@
int dummy;
XCharStruct chars;
unsigned long event_mask;
+ int fdelay = 0;
+
+ /* User may set FRAME_DELAY from the command line */
+ if (argc >= 2) {
+ fdelay = atoi(argv[1]);
+ }
/* open the display */
display = XOpenDisplay(NULL);
@@ -64,17 +70,18 @@
}
/* go to it */
- play_game();
+ play_game(fdelay);
/* exit */
do_exit();
+ return 0;
}
/*
* The following function contains the main game loop.
*/
-play_game() {
+void play_game(fdelay) {
register int i;
char c_buf;
XComposeStatus status;
@@ -166,7 +173,7 @@
if (event.xany.window != window) continue;
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if (last_key == XK_space)
if (!pause_seq())
goto demo;
@@ -325,7 +332,11 @@
XSync(display, False);
#ifdef FRAME_DELAY
- usleep(FRAME_DELAY);
+ if (fdelay > 0) {
+ usleep(fdelay);
+ } else {
+ usleep(FRAME_DELAY);
+ }
#endif
} /* while */
@@ -347,7 +358,7 @@
}
-do_exit()
+void do_exit()
{
destroy_regions();
XUnmapWindow(display, window);

View File

@ -0,0 +1,20 @@
--- maze.c.orig
+++ maze.c
@@ -124,7 +124,7 @@
"z---x---x---x---x---c" } };
-read_maze(num)
+void read_maze(num)
int num;
{
int i, xx, yy;
@@ -259,7 +259,7 @@
* The function which follows is used at the beginning of each level to
* set up the initial parameters for all of the moving figures.
*/
-position_players()
+void position_players()
{
int i;
XRectangle ghost_rect[MAX_GHOSTS], pac_rect;

View File

@ -0,0 +1,74 @@
--- props.c.orig
+++ props.c
@@ -9,7 +9,7 @@
/* the get-ready sequence */
-get_ready()
+void get_ready()
{
int xx, yy, i;
int direction, ascent, descent;
@@ -41,7 +41,7 @@
/* the game-over sequence */
-game_over()
+void game_over()
{
int xx, yy;
int direction, ascent, descent;
@@ -64,7 +64,7 @@
/* the end-of-level sequence -- the screen flashes a few times */
-finish()
+void finish()
{
int i;
@@ -115,7 +115,7 @@
if (event.xany.window != window) continue;
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if ((last_key == XK_q) || (last_key == XK_Q))
do_exit();
if ((last_key == XK_r) || (last_key == XK_R))
@@ -136,7 +136,7 @@
}
-do_sleep(secs)
+void do_sleep(secs)
{
int i;
@@ -147,7 +147,7 @@
}
-do_usleep(usecs)
+void do_usleep(usecs)
{
int i, d, r;
@@ -164,7 +164,7 @@
}
-check_normal_events()
+void check_normal_events()
{
char c_buf;
XEvent event;
@@ -175,7 +175,7 @@
if (event.xany.window != window) continue;
switch (event.type) {
case KeyPress:
- XLookupString(&event, &c_buf, 1, &last_key, &status);
+ XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
if (last_key == XK_space)
if (!pause_seq())
longjmp(jb_start, 1);

View File

@ -0,0 +1,102 @@
--- resources.c.orig
+++ resources.c
@@ -9,7 +9,7 @@
* contexts.
*/
-create_window(argc, argv)
+void create_window(argc, argv)
int argc;
char *argv[];
{
@@ -39,7 +39,7 @@
}
-create_pac()
+void create_pac()
{
int i;
@@ -127,7 +127,7 @@
}
-create_ghost()
+void create_ghost()
{
int i;
@@ -164,7 +164,7 @@
}
-create_maze_symbols()
+void create_maze_symbols()
{
int i;
Pixmap empty;
@@ -190,7 +190,7 @@
}
-create_maps()
+void create_maps()
{
powermap = XCreatePixmap(display, root, WIN_WIDTH, WIN_HEIGHT, depth);
save = XCreatePixmap(display, root, WIN_WIDTH, WIN_HEIGHT, depth);
@@ -199,8 +199,7 @@
}
-
-create_fruit()
+void create_fruit()
{
fruit_pix[0] = XCreatePixmapFromBitmapData(display, root, fcherry_bits,
GHOST_SIZE, GHOST_SIZE, 1, 0, 1);
@@ -261,7 +260,7 @@
}
-create_GCs()
+void create_GCs()
{
XGCValues gcv;
unsigned long mask;
@@ -341,7 +340,7 @@
}
-create_demo_images()
+void create_demo_images()
{
demo_mask[0] = XCreatePixmapFromBitmapData(display, root, bigc_bits,
48, 48, 1, 0, 1);
@@ -380,7 +379,7 @@
}
-clear_maps()
+void clear_maps()
{
XFillRectangle(display, powermap, clearGC, 0, 0, WIN_WIDTH, WIN_HEIGHT);
XFillRectangle(display, save, clearGC, 0, 0, WIN_WIDTH, WIN_HEIGHT);
@@ -388,7 +387,7 @@
}
-create_regions()
+void create_regions()
{
XRectangle full_rect;
int i;
@@ -411,7 +410,7 @@
}
-destroy_regions()
+void destroy_regions()
{
int i;

View File

@ -0,0 +1,37 @@
--- status.c.orig
+++ status.c
@@ -8,7 +8,7 @@
* score, the fruit level, and the number of lives remaining.
*/
-print_score(incr)
+void print_score(incr)
long incr;
{
static char string[6];
@@ -48,7 +48,7 @@
}
-display_level(slowly)
+void display_level(slowly)
Bool slowly;
{
int i, xx;
@@ -73,14 +73,14 @@
}
-display_title()
+void display_title()
{
XCopyPlane(display, title, window, fullcopyGC, 0, 0, TITLE_WIDTH,
TITLE_HEIGHT, 12 * GHOST_SIZE, WIN_HEIGHT + 1, 1);
}
-restore_status()
+void restore_status()
{
print_score(0L);
(void)set_lives(lives);

View File

@ -0,0 +1,67 @@
--- xchomp.h.orig
+++ xchomp.h
@@ -6,6 +6,7 @@
#include <signal.h>
#include <setjmp.h>
#include <string.h>
+#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -74,7 +75,7 @@
typedef int intm[8];
typedef char charm[BLOCK_WIDTH];
typedef charm mazedata[BLOCK_HEIGHT];
-typedef int (*funcptr)();
+typedef void (*funcptr)();
EXTERN Atom DEC_icon_atom;
@@ -136,6 +137,44 @@
EXTERN jmp_buf jb_start;
-extern follow(), hover(), hover2(), run(), go_home();
-extern die(), eat(), noop();
-extern Bool pause_seq();
+EXTERN void follow(int);
+EXTERN void run(int);
+EXTERN void go_home(int);
+EXTERN void hover(int);
+EXTERN void hover2(int);
+EXTERN void die(int);
+EXTERN void eat(int);
+EXTERN void noop(int);
+EXTERN Bool pause_seq();
+
+void do_exit();
+void play_game(int);
+void destroy_regions();
+void create_ghost();
+void create_pac();
+void create_fruit();
+void create_maze_symbols();
+void create_demo_images();
+void create_GCs();
+void create_window(int, char **);
+void create_maps();
+void create_regions();
+void demo_seq();
+void display_title();
+void print_score(long);
+void display_level(Bool);
+void clear_maps();
+void read_maze(int);
+void position_players();
+int set_lives(int);
+void get_ready();
+void restore_status();
+void control_pac();
+void usleep(int);
+void do_sleep(int);
+void do_usleep(int);
+void game_over();
+void finish();
+void control_pac();
+void check_dots();
+void check_normal_events();