Subject: bin/5841: [PATCH] sail uses move() from curses, and defines its own
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm@octomino.demon.co.uk>
List: netbsd-bugs
Date: 07/25/1998 09:01:44
>Number: 5841
>Category: bin
>Synopsis: [PATCH] sail uses move() from curses, and defines its own
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jul 25 03:35:01 1998
>Last-Modified:
>Originator: Joseph Samuel Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release: NetBSD-current of 1998-07-11
>Environment:
[
System: Linux octomino 2.0.35 #1 Tue Jul 14 19:09:50 UTC 1998 i586 unknown
Architecture: i586
]
>Description:
The sail game uses move() from curses, but also has an internal
routine of the same name and different prototype. The patch below,
which is what I used in the Linux port, changes the name of the
internal function; another way of doing things would be to make the
function static and remove the prototype from extern.h. (I don't see
how this ever worked, unless NetBSD <curses.h> has no prototype for
move() and it is a macro.)
>How-To-Repeat:
>Fix:
diff -ruN sail/dr_2.c sail+/dr_2.c
--- sail/dr_2.c Tue Oct 14 11:09:41 1997
+++ sail+/dr_2.c Sat Jul 25 08:50:09 1998
@@ -170,7 +170,7 @@
row = fp->row;
col = fp->col;
drift = fp->drift;
- move(movement, ship, &fp->dir, &fp->row, &fp->col, &drift);
+ sail_move(movement, ship, &fp->dir, &fp->row, &fp->col, &drift);
if (!*movement)
(void) strcpy(movement, "d");
@@ -190,7 +190,7 @@
}
void
-move(p, ship, dir, row, col, drift)
+sail_move(p, ship, dir, row, col, drift)
char *p;
struct ship *ship;
unsigned char *dir;
diff -ruN sail/extern.h sail+/extern.h
--- sail/extern.h Sun Mar 29 12:14:01 1998
+++ sail+/extern.h Sat Jul 25 08:49:23 1998
@@ -317,7 +317,7 @@
int strend __P((char *));
void closeon __P((struct ship *, struct ship *, char[], int, int, int));
int score __P((char[], struct ship *, struct ship *, int));
-void move __P((char *, struct ship *, unsigned char *, short *, short *, char *));
+void sail_move __P((char *, struct ship *, unsigned char *, short *, short *, char *));
void try __P((char[], char [], int, int, int, int, int, struct ship *,
struct ship *, int *, int));
void rmend __P((char *));
>Audit-Trail:
>Unformatted: