Subject: pkg/14911: games/maelstrom has gcc 2.95.3 compilation problems
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 12/11/2001 12:17:28
>Number:         14911
>Category:       pkg
>Synopsis:       games/maelstrom has gcc 2.95.3 compilation problems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 11 00:02:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD 1.5Y 20011126  (pkgsrc 20011206)
>Organization:
	Prince of Songkla University
>Environment:
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD fuchsia 1.5Y NetBSD 1.5Y (FUCHSIA) #2: Mon Nov 26 13:41:27 ICT 2001 kre@fuchsia:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386
>Description:
	games/maelstrom has gcc 2.95.3 compilation problems
>How-To-Repeat:
	Be running the new toolchain

	cd pkgsrc/games/maelstrom
	make

	Wait for ...

netplay.cpp: In function `int Await_NewGame(int *, int *, int *)':
netplay.cpp:995: passing `int *' as argument 6 of `recvfrom(int, void *, unsigned int, int, sockaddr *, __socklen_t *)' changes signedness
*** Error code 1

Stop.
make: stopped in /usr/obj/pkg/games/maelstrom/work.i386/Maelstrom/netlogic
*** Error code 1

	Fix that, as below, then:

	make

	Wait for ...

fastrand.cpp: In function `void SeedRandom(long unsigned int)':
fastrand.cpp:17: ANSI C++ forbids implicit conversion from `void *' in argument passing
*** Error code 1

Stop.
make: stopped in /usr/obj/pkg/games/maelstrom/work.i386/Maelstrom
*** Error code 1

>Fix:
	Unpack the appended shar file in games/maelstrom
	It will create two new patch files (patch-ah and patch-ai)
	which correct the two problems above.
		make distinfo
	then checkin, and it should be done...

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	patches/patch-ah
#	patches/patch-ai
#
echo x - patches/patch-ah
sed 's/^X//' >patches/patch-ah << 'END-of-patches/patch-ah'
X$NetBSD$
X
X+++ netlogic/netplay.cpp	Tue Dec 11 09:53:18 2001
X@@ -25,6 +25,10 @@
X #include <arpa/inet.h>
X #endif /* Win95 */
X 
X+#ifndef socklen_t
X+#define	socklen_t unsigned int
X+#endif
X+
X int   gNumPlayers;
X int   gOurPlayer;
X int   gDeathMatch;
X@@ -352,7 +356,8 @@
X int SyncNetwork(void)
X {
X 	int  nleft;
X-	int  i, clen, len;
X+	int  i, len;
X+	socklen_t clen;
X 	struct sockaddr_in from;
X 	unsigned long frame, seed, newseed;
X 	struct timeval timeout;
X@@ -567,7 +572,7 @@
X 	struct timeval timeout;
X 	fd_set fdset;
X 	char   netbuf[BUFSIZ];
X-	int    clen;
X+	socklen_t clen;
X 	struct sockaddr_in from;
X 	
X 	timeout.tv_sec = 0;
X@@ -807,7 +812,8 @@
X 	char message[BUFSIZ];
X 	int  nleft, n;
X 	int  acked[MAX_PLAYERS];
X-	int  i, clen, len;
X+	int  i, len;
X+	socklen_t clen;
X 	struct sockaddr_in from;
X 	struct timeval timeout;
X 	fd_set fdset;
X@@ -939,7 +945,8 @@
X int Await_NewGame(int *Wave, int *Lives, int *Turbo)
X {
X 	unsigned char netbuf[BUFSIZ];
X-	int   i, clen, len, gameon;
X+	int   i, len, gameon;
X+	socklen_t clen;
X 	struct sockaddr_in from;
X 	fd_set fdset;
X 	struct timeval timeout;
END-of-patches/patch-ah
echo x - patches/patch-ai
sed 's/^X//' >patches/patch-ai << 'END-of-patches/patch-ai'
X$NetBSD$
X
X+++ fastrand.cpp	Tue Dec 11 09:56:52 2001
X@@ -14,7 +14,7 @@
X printf("SeedRandom(%lu)\n", Seed);
X #endif
X 	if ( ! Seed ) {
X-		gettimeofday(&tv, (void *)0);
X+		gettimeofday(&tv, (struct timezone *)0);
X 		randomSeed = ((tv.tv_usec<<16)|((tv.tv_sec^tv.tv_usec)&0xFFFF));
X 		return;
X 	}
END-of-patches/patch-ai
exit

>Release-Note:
>Audit-Trail:
>Unformatted:
 	<Please check that the above is correct for the bug being reported,>
 	<and append source date of snapshot, if applicable (one line).>