View | Details | Raw Unified | Return to bug 175572 | Differences between
and this patch

Collapse All | Expand All

(-)games/xchomp/Makefile (-8 / +9 lines)
Lines 1-22 Link Here
1
# New ports collection makefile for:    xchomp
1
# Created by: swallace
2
# Date created:         4 Jan 1995
3
# Whom:                 swallace
4
#
5
# $FreeBSD: head/games/xchomp/Makefile 300896 2012-07-14 13:54:48Z beat $
2
# $FreeBSD: head/games/xchomp/Makefile 300896 2012-07-14 13:54:48Z beat $
6
#
7
3
8
PORTNAME=	xchomp
4
PORTNAME=	xchomp
9
PORTVERSION=	pl1
5
PORTVERSION=	pl1
10
PORTREVISION=	2
6
PORTREVISION=	2
11
CATEGORIES=	games
7
CATEGORIES=	games
12
MASTER_SITES=	ftp://ftp.x.org/R5contrib/
8
MASTER_SITES=	XCONTRIB/../R5contrib
13
9
14
MAINTAINER=	ports@FreeBSD.org
10
MAINTAINER=	ports@FreeBSD.org
15
COMMENT=	Pac-man-like game under X11
11
COMMENT=	Pac-man-like game under X11
16
12
17
PLIST_FILES=	bin/xchomp
18
WRKSRC=		${WRKDIR}/xchomp
13
WRKSRC=		${WRKDIR}/xchomp
19
USE_IMAKE=	yes
14
20
USE_XORG=	x11 xext
15
USE_XORG=	x11 xext
16
USE_IMAKE=	yes
17
MAKE_JOBS_SAFE=	yes
18
19
PLIST_FILES=	bin/xchomp
20
21
DESKTOP_ENTRIES="Xchomp" "" "" "${PORTNAME}" "" false
21
22
22
.include <bsd.port.mk>
23
.include <bsd.port.mk>
(-)games/xchomp/files/patch-ac (-9 lines)
Lines 1-9 Link Here
1
--- demo.c.orig	Fri Mar 18 06:12:23 1994
2
+++ demo.c	Thu Mar 16 15:45:38 2000
3
@@ -128,5 +128,5 @@
4
       switch (event.type) {
5
          case KeyPress:
6
-	    XLookupString(&event, &c_buf, 1, &last_key, &status);
7
+	    XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
8
 	    if ((last_key == XK_q) || (last_key == XK_Q))
9
 	       do_exit();
(-)games/xchomp/files/patch-ad (-9 lines)
Lines 1-9 Link Here
1
--- main.c.orig	Fri Mar 18 06:12:24 1994
2
+++ main.c	Thu Mar 16 15:45:54 2000
3
@@ -167,5 +167,5 @@
4
          switch (event.type) {
5
             case KeyPress:
6
-               XLookupString(&event, &c_buf, 1, &last_key, &status);
7
+               XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
8
                if (last_key == XK_space)
9
                   if (!pause_seq())
(-)games/xchomp/files/patch-ae (-16 lines)
Lines 1-16 Link Here
1
--- props.c.orig	Fri Mar 18 06:13:17 1994
2
+++ props.c	Thu Mar 16 15:46:08 2000
3
@@ -116,5 +116,5 @@
4
       switch (event.type) {
5
 	 case KeyPress:
6
-	    XLookupString(&event, &c_buf, 1, &last_key, &status);
7
+	    XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
8
 	    if ((last_key == XK_q) || (last_key == XK_Q))
9
 	       do_exit();
10
@@ -176,5 +176,5 @@
11
       switch (event.type) {
12
          case KeyPress:
13
-            XLookupString(&event, &c_buf, 1, &last_key, &status);
14
+            XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
15
             if (last_key == XK_space)
16
                if (!pause_seq())
(-)games/xchomp/files/patch-contact.c (+29 lines)
Line 0 Link Here
1
--- contact.c.orig
2
+++ contact.c
3
@@ -17,7 +17,7 @@
4
  * with which the player collided.  In this case, it doesn't matter.
5
  */
6
 /*ARGSUSED*/
7
-die(dummy)
8
+void die(dummy)
9
 int dummy;
10
 {
11
    register int xx = pac_x, yy = pac_y, i, dx, dy;
12
@@ -116,7 +116,7 @@
13
  * of the eaten ghost, and then continues.  The parameter is
14
  * the array index of the eaten ghost.
15
  */
16
-eat(i)
17
+void eat(i)
18
 int i;
19
 {
20
    register int  xx = pac_x, yy = pac_y, j;
21
@@ -166,7 +166,7 @@
22
  * The eyes are harmless; this is a no-op.
23
  */
24
 /*ARGSUSED*/
25
-noop(dummy)
26
+void noop(dummy)
27
 int dummy;
28
 {
29
 }
(-)games/xchomp/files/patch-demo.c (+20 lines)
Line 0 Link Here
1
--- demo.c.orig
2
+++ demo.c
3
@@ -6,7 +6,7 @@
4
  * for the game.
5
  */
6
 
7
-demo_seq()
8
+void demo_seq()
9
 {
10
    int             i, xx, yy, direction, ascent, descent, len;
11
    XCharStruct     chars;
12
@@ -127,7 +127,7 @@
13
       if (event.xany.window != window) continue;
14
       switch (event.type) {
15
          case KeyPress:
16
-	    XLookupString(&event, &c_buf, 1, &last_key, &status);
17
+	    XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
18
 	    if ((last_key == XK_q) || (last_key == XK_Q))
19
 	       do_exit();
20
 	    XFillRectangle(display, window, clearGC, 0, 0, WIN_WIDTH,
(-)games/xchomp/files/patch-drivers.c (+97 lines)
Line 0 Link Here
1
--- drivers.c.orig
2
+++ drivers.c
3
@@ -12,7 +12,7 @@
4
  * variables (pac_x, pac_y), the direction variables (pac_ix, pac_iy),
5
  * and the clipping region (pac_region).
6
  */
7
-control_pac()
8
+void control_pac()
9
 {
10
    register int         xx = pac_x, yy = pac_y, i, dx, dy;
11
    register char        *pc = md[yy >> 4] + (xx >> 4);
12
@@ -89,7 +89,7 @@
13
  * eaten something which is not a ghost -- a dot, a power-dot,
14
  * or the fruit.  If so, the appropriate action is taken.
15
  */
16
-check_dots()
17
+void check_dots()
18
 {
19
    register char        *pi;
20
    register int         i;
21
@@ -218,7 +218,7 @@
22
  * The function below causes ghosts to follow the player around, with a bit
23
  * of randomness thrown in as well.
24
  */
25
-follow(i)
26
+void follow(i)
27
 register int i;
28
 {
29
    int            xx = ghost_x[i], yy = ghost_y[i];
30
@@ -289,7 +289,7 @@
31
  * at half speed.  It is set up as the driver function during
32
  * the ghost-eating periods of the game.
33
  */
34
-run(i)
35
+void run(i)
36
 register int i;
37
 {
38
    int            xx = ghost_x[i], yy = ghost_y[i];
39
@@ -358,7 +358,7 @@
40
  * high speed.  It is set up as the driver for ghosts which have
41
  * been eaten.
42
  */
43
-go_home(i)
44
+void go_home(i)
45
 register int i;
46
 {
47
    int            xx = ghost_x[i], yy = ghost_y[i];
48
@@ -459,14 +459,14 @@
49
  * They simply hover around in a circular pattern.  Randomness is
50
  * used to decide when the ghosts leave the box.
51
  */
52
-hover(i)
53
+void hover(i)
54
 register int i;
55
 {
56
    register int yy = ghost_y[i] >> 4, xx = ghost_x[i] >> 4;
57
    char         *pc = md[yy] + xx;
58
    register int *px = ghost_ix + i, *py = ghost_iy + i;
59
 
60
-   if (xx == door_x)
61
+   if (xx == door_x) {
62
       if (yy == (door_y - 1)) {
63
 
64
 	 /*
65
@@ -490,6 +490,7 @@
66
                *px = 0, *py = (-2);
67
                return;
68
             }
69
+   }
70
 
71
    /*
72
     * The rest of the function drives the ghost around the
73
@@ -514,14 +515,14 @@
74
  * the ghost-eating periods of the game -- they move at half
75
  * speed.
76
  */
77
-hover2(i)
78
+void hover2(i)
79
 register int i;
80
 {
81
    register int yy = ghost_y[i] >> 4, xx = ghost_x[i] >> 4;
82
    char         *pc = md[yy] + xx;
83
    register int *px = ghost_ix + i, *py = ghost_iy + i;
84
 
85
-   if (xx == door_x)
86
+   if (xx == door_x) {
87
       if (yy == (door_y - 1)) {
88
          drive[i] = run;
89
          run(i);
90
@@ -532,6 +533,7 @@
91
             *px = 0, *py = (-1);
92
             return;
93
          }
94
+   }
95
 
96
    if (*px > 0) {
97
       if (pc[1]) *px = 0, *py = (-1);
(-)games/xchomp/files/patch-main.c (+76 lines)
Line 0 Link Here
1
--- main.c.orig
2
+++ main.c
3
@@ -2,7 +2,7 @@
4
 #define EXTERN
5
 #include "xchomp.h"
6
 
7
-main(argc, argv)
8
+int main(argc, argv)
9
 int argc;
10
 char *argv[];
11
 {
12
@@ -10,6 +10,12 @@
13
    int			dummy;
14
    XCharStruct		chars;
15
    unsigned long	event_mask;
16
+   int                  fdelay = 0;
17
+
18
+   /* User may set FRAME_DELAY from the command line */
19
+   if (argc >= 2) {
20
+      fdelay = atoi(argv[1]);
21
+   }
22
 
23
    /* open the display */
24
    display 	= XOpenDisplay(NULL);
25
@@ -64,17 +70,18 @@
26
    }
27
 
28
    /* go to it */
29
-   play_game();
30
+   play_game(fdelay);
31
 
32
    /* exit */
33
    do_exit();
34
+   return 0;
35
 }
36
 
37
 
38
 /* 
39
  * The following function contains the main game loop.
40
  */
41
-play_game() {
42
+void play_game(fdelay) {
43
    register int    i;
44
    char            c_buf;
45
    XComposeStatus  status;
46
@@ -166,7 +173,7 @@
47
          if (event.xany.window != window) continue;
48
          switch (event.type) {
49
             case KeyPress:
50
-               XLookupString(&event, &c_buf, 1, &last_key, &status);
51
+               XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
52
                if (last_key == XK_space)
53
                   if (!pause_seq())
54
                      goto demo;
55
@@ -325,7 +332,11 @@
56
       XSync(display, False);
57
 
58
 #ifdef FRAME_DELAY
59
-      usleep(FRAME_DELAY);
60
+      if (fdelay > 0) {
61
+         usleep(fdelay);
62
+      } else {
63
+         usleep(FRAME_DELAY);
64
+      }
65
 #endif
66
 
67
    } /* while */
68
@@ -347,7 +358,7 @@
69
 }
70
 
71
 
72
-do_exit()
73
+void do_exit()
74
 {
75
    destroy_regions();
76
    XUnmapWindow(display, window);
(-)games/xchomp/files/patch-maze.c (+20 lines)
Line 0 Link Here
1
--- maze.c.orig
2
+++ maze.c
3
@@ -124,7 +124,7 @@
4
 		  "z---x---x---x---x---c" } };
5
 
6
 
7
-read_maze(num)
8
+void read_maze(num)
9
 int num;
10
 {
11
    int          i, xx, yy;
12
@@ -259,7 +259,7 @@
13
  * The function which follows is used at the beginning of each level to
14
  * set up the initial parameters for all of the moving figures.
15
  */
16
-position_players()
17
+void position_players()
18
 {
19
    int 		i;
20
    XRectangle	ghost_rect[MAX_GHOSTS], pac_rect;
(-)games/xchomp/files/patch-props.c (+74 lines)
Line 0 Link Here
1
--- props.c.orig
2
+++ props.c
3
@@ -9,7 +9,7 @@
4
 
5
 
6
 /* the get-ready sequence */
7
-get_ready()
8
+void get_ready()
9
 {
10
    int          xx, yy, i;
11
    int          direction, ascent, descent;
12
@@ -41,7 +41,7 @@
13
 
14
 
15
 /* the game-over sequence */
16
-game_over()
17
+void game_over()
18
 {
19
    int          xx, yy;
20
    int          direction, ascent, descent;
21
@@ -64,7 +64,7 @@
22
 
23
 
24
 /* the end-of-level sequence -- the screen flashes a few times */
25
-finish()
26
+void finish()
27
 {
28
    int i;
29
 
30
@@ -115,7 +115,7 @@
31
       if (event.xany.window != window) continue;
32
       switch (event.type) {
33
 	 case KeyPress:
34
-	    XLookupString(&event, &c_buf, 1, &last_key, &status);
35
+	    XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
36
 	    if ((last_key == XK_q) || (last_key == XK_Q))
37
 	       do_exit();
38
 	    if ((last_key == XK_r) || (last_key == XK_R))
39
@@ -136,7 +136,7 @@
40
 }
41
 
42
 
43
-do_sleep(secs)
44
+void do_sleep(secs)
45
 {
46
    int i;
47
 
48
@@ -147,7 +147,7 @@
49
 }
50
 
51
 
52
-do_usleep(usecs)
53
+void do_usleep(usecs)
54
 {
55
    int i, d, r;
56
 
57
@@ -164,7 +164,7 @@
58
 }
59
 
60
 
61
-check_normal_events()
62
+void check_normal_events()
63
 {
64
    char			c_buf;
65
    XEvent		event;
66
@@ -175,7 +175,7 @@
67
       if (event.xany.window != window) continue;
68
       switch (event.type) {
69
          case KeyPress:
70
-            XLookupString(&event, &c_buf, 1, &last_key, &status);
71
+            XLookupString((XKeyEvent *) &event, &c_buf, 1, &last_key, &status);
72
             if (last_key == XK_space)
73
                if (!pause_seq())
74
                   longjmp(jb_start, 1);
(-)games/xchomp/files/patch-resources.c (+102 lines)
Line 0 Link Here
1
--- resources.c.orig
2
+++ resources.c
3
@@ -9,7 +9,7 @@
4
  * contexts.
5
  */
6
 
7
-create_window(argc, argv)
8
+void create_window(argc, argv)
9
 int argc;
10
 char *argv[];
11
 {
12
@@ -39,7 +39,7 @@
13
 }
14
 
15
 
16
-create_pac()
17
+void create_pac()
18
 {
19
    int i;
20
 
21
@@ -127,7 +127,7 @@
22
 }
23
 
24
 
25
-create_ghost()
26
+void create_ghost()
27
 {
28
    int i;
29
 
30
@@ -164,7 +164,7 @@
31
 }
32
 
33
 
34
-create_maze_symbols()
35
+void create_maze_symbols()
36
 {
37
    int          i;
38
    Pixmap       empty;
39
@@ -190,7 +190,7 @@
40
 }
41
 
42
 
43
-create_maps()
44
+void create_maps()
45
 {
46
    powermap = XCreatePixmap(display, root, WIN_WIDTH, WIN_HEIGHT, depth);
47
    save = XCreatePixmap(display, root, WIN_WIDTH, WIN_HEIGHT, depth);
48
@@ -199,8 +199,7 @@
49
 }
50
 
51
 
52
-
53
-create_fruit()
54
+void create_fruit()
55
 {
56
    fruit_pix[0] = XCreatePixmapFromBitmapData(display, root, fcherry_bits,
57
       GHOST_SIZE, GHOST_SIZE, 1, 0, 1);
58
@@ -261,7 +260,7 @@
59
 }
60
 
61
 
62
-create_GCs()
63
+void create_GCs()
64
 {
65
    XGCValues            gcv;
66
    unsigned long        mask;
67
@@ -341,7 +340,7 @@
68
 }
69
 
70
 
71
-create_demo_images()
72
+void create_demo_images()
73
 {
74
    demo_mask[0] = XCreatePixmapFromBitmapData(display, root, bigc_bits,
75
       48, 48, 1, 0, 1);
76
@@ -380,7 +379,7 @@
77
 }
78
 
79
 
80
-clear_maps()
81
+void clear_maps()
82
 {
83
    XFillRectangle(display, powermap, clearGC, 0, 0, WIN_WIDTH, WIN_HEIGHT);
84
    XFillRectangle(display, save, clearGC, 0, 0, WIN_WIDTH, WIN_HEIGHT);
85
@@ -388,7 +387,7 @@
86
 }
87
 
88
 
89
-create_regions()
90
+void create_regions()
91
 {
92
    XRectangle	full_rect;
93
    int		i;
94
@@ -411,7 +410,7 @@
95
 }
96
 
97
 
98
-destroy_regions()
99
+void destroy_regions()
100
 {
101
    int i;
102
(-)games/xchomp/files/patch-status.c (+37 lines)
Line 0 Link Here
1
--- status.c.orig
2
+++ status.c
3
@@ -8,7 +8,7 @@
4
  * score, the fruit level, and the number of lives remaining.
5
  */
6
 
7
-print_score(incr)
8
+void print_score(incr)
9
 long incr;
10
 {
11
    static char          string[6];
12
@@ -48,7 +48,7 @@
13
 }
14
 
15
 
16
-display_level(slowly)
17
+void display_level(slowly)
18
 Bool slowly;
19
 {
20
    int i, xx;
21
@@ -73,14 +73,14 @@
22
 }
23
 
24
 
25
-display_title()
26
+void display_title()
27
 {
28
    XCopyPlane(display, title, window, fullcopyGC, 0, 0, TITLE_WIDTH,
29
       TITLE_HEIGHT, 12 * GHOST_SIZE, WIN_HEIGHT + 1, 1);
30
 }
31
 
32
 
33
-restore_status()
34
+void restore_status()
35
 {
36
    print_score(0L);
37
    (void)set_lives(lives);
(-)games/xchomp/files/patch-xchomp.h (+67 lines)
Line 0 Link Here
1
--- xchomp.h.orig
2
+++ xchomp.h
3
@@ -6,6 +6,7 @@
4
 #include <signal.h>
5
 #include <setjmp.h>
6
 #include <string.h>
7
+#include <stdlib.h>
8
 
9
 #include <X11/Xlib.h>
10
 #include <X11/Xutil.h>
11
@@ -74,7 +75,7 @@
12
 typedef int		intm[8];
13
 typedef char		charm[BLOCK_WIDTH];
14
 typedef charm		mazedata[BLOCK_HEIGHT];
15
-typedef int		(*funcptr)();
16
+typedef void		(*funcptr)();
17
 
18
 EXTERN Atom		DEC_icon_atom;
19
 
20
@@ -136,6 +137,44 @@
21
 
22
 EXTERN jmp_buf		jb_start;
23
 
24
-extern			follow(), hover(), hover2(), run(), go_home();
25
-extern			die(), eat(), noop();
26
-extern Bool		pause_seq();
27
+EXTERN void		follow(int);
28
+EXTERN void		run(int);
29
+EXTERN void		go_home(int);
30
+EXTERN void		hover(int);
31
+EXTERN void		hover2(int);
32
+EXTERN void		die(int);
33
+EXTERN void		eat(int);
34
+EXTERN void		noop(int);
35
+EXTERN Bool		pause_seq();
36
+
37
+void do_exit();  
38
+void play_game(int);
39
+void destroy_regions();
40
+void create_ghost();
41
+void create_pac();  
42
+void create_fruit();
43
+void create_maze_symbols();
44
+void create_demo_images();
45
+void create_GCs();
46
+void create_window(int, char **);
47
+void create_maps();   
48
+void create_regions();
49
+void demo_seq();
50
+void display_title();    
51
+void print_score(long);  
52
+void display_level(Bool);
53
+void clear_maps();  
54
+void read_maze(int);
55
+void position_players();
56
+int set_lives(int);
57
+void get_ready();
58
+void restore_status();
59
+void control_pac();
60
+void usleep(int);  
61
+void do_sleep(int);
62
+void do_usleep(int);
63
+void game_over();
64
+void finish();
65
+void control_pac();
66
+void check_dots();
67
+void check_normal_events();

Return to bug 175572