Module Name:    src
Committed By:   dholland
Date:           Sat Jul  4 01:23:55 UTC 2009

Modified Files:
        src/games/hunt/hunt: connect.c hunt.c playit.c

Log Message:
Remove bogus casts. Two object file diffs inspected and found to be harmless.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/games/hunt/hunt/connect.c
cvs rdiff -u -r1.28 -r1.29 src/games/hunt/hunt/hunt.c
cvs rdiff -u -r1.9 -r1.10 src/games/hunt/hunt/playit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/hunt/hunt/connect.c
diff -u src/games/hunt/hunt/connect.c:1.5 src/games/hunt/hunt/connect.c:1.6
--- src/games/hunt/hunt/connect.c:1.5	Wed Jun 11 12:00:21 2003
+++ src/games/hunt/hunt/connect.c	Sat Jul  4 01:23:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: connect.c,v 1.5 2003/06/11 12:00:21 wiz Exp $	*/
+/*	$NetBSD: connect.c,v 1.6 2009/07/04 01:23:55 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: connect.c,v 1.5 2003/06/11 12:00:21 wiz Exp $");
+__RCSID("$NetBSD: connect.c,v 1.6 2009/07/04 01:23:55 dholland Exp $");
 #endif /* not lint */
 
 # include	"hunt.h"
@@ -50,11 +50,11 @@
 
 	if (uid == 0)
 		uid = htonl(getuid());
-	(void) write(Socket, (char *) &uid, LONGLEN);
+	(void) write(Socket, &uid, LONGLEN);
 	(void) write(Socket, name, NAMELEN);
 	(void) write(Socket, &team, 1);
 	enter_status = htonl(enter_status);
-	(void) write(Socket, (char *) &enter_status, LONGLEN);
+	(void) write(Socket, &enter_status, LONGLEN);
 	(void) strcpy(Buf, ttyname(fileno(stderr)));
 	(void) write(Socket, Buf, NAMELEN);
 # ifdef INTERNET
@@ -69,5 +69,5 @@
 # endif
 		mode = C_PLAYER;
 	mode = htonl(mode);
-	(void) write(Socket, (char *) &mode, sizeof mode);
+	(void) write(Socket, &mode, sizeof mode);
 }

Index: src/games/hunt/hunt/hunt.c
diff -u src/games/hunt/hunt/hunt.c:1.28 src/games/hunt/hunt/hunt.c:1.29
--- src/games/hunt/hunt/hunt.c:1.28	Sun Jun 28 21:12:10 2009
+++ src/games/hunt/hunt/hunt.c	Sat Jul  4 01:23:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.28 2009/06/28 21:12:10 dholland Exp $	*/
+/*	$NetBSD: hunt.c,v 1.29 2009/07/04 01:23:55 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.28 2009/06/28 21:12:10 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.29 2009/07/04 01:23:55 dholland Exp $");
 #endif /* not lint */
 
 # include	<sys/param.h>
@@ -365,7 +365,7 @@
 		if ((enter_status = quit(enter_status)) == Q_QUIT)
 			break;
 	}
-	leavex(0, (char *) NULL);
+	leavex(0, NULL);
 	/* NOTREACHED */
 	return(0);
 }
@@ -473,7 +473,7 @@
 		/* favor host of previous session by broadcasting to it first */
 		test.sin_addr = Daemon.sin_addr;
 		msg = htons(C_PLAYER);		/* Must be playing! */
-		(void) sendto(test_socket, (char *) &msg, sizeof msg, 0,
+		(void) sendto(test_socket, &msg, sizeof msg, 0,
 		    (struct sockaddr *) &test, DAEMON_SIZE);
 	}
 
@@ -515,7 +515,7 @@
 	while (hp = gethostent()) {
 		if (local_net == inet_netof(* ((struct in_addr *) hp->h_addr))){
 			test.sin_addr = * ((struct in_addr *) hp->h_addr);
-			(void) sendto(test_socket, (char *) &msg, sizeof msg, 0,
+			(void) sendto(test_socket, &msg, sizeof msg, 0,
 			    (struct sockaddr *) &test, DAEMON_SIZE);
 		}
 	}
@@ -529,12 +529,11 @@
 	for (;;) {
 		if (listc + 1 >= listmax) {
 			listmax += 20;
-			listv = (SOCKET *) realloc((char *) listv,
-						listmax * sizeof(SOCKET));
+			listv = realloc(listv, listmax * sizeof(SOCKET));
 		}
 
 		if (poll(set, 1, 1000) == 1 &&
-		    recvfrom(test_socket, (char *) &port_num, sizeof(port_num),
+		    recvfrom(test_socket, &port_num, sizeof(port_num),
 		    0, (struct sockaddr *) &listv[listc], &namelen) > 0) {
 			/*
 			 * Note that we do *not* convert from network to host
@@ -567,7 +566,7 @@
 
 test_one_host:
 	msg = htons(C_TESTMSG());
-	(void) sendto(test_socket, (char *) &msg, sizeof msg, 0,
+	(void) sendto(test_socket, &msg, sizeof msg, 0,
 	    (struct sockaddr *) &test, DAEMON_SIZE);
 	goto get_response;
 }
@@ -757,7 +756,7 @@
 sigterm(dummy)
 	int dummy __unused;
 {
-	leavex(0, (char *) NULL);
+	leavex(0, NULL);
 	/* NOTREACHED */
 }
 
@@ -838,7 +837,7 @@
 				(void) write(Socket, "q", 1);
 				(void) close(Socket);
 			}
-			leavex(0, (char *) NULL);
+			leavex(0, NULL);
 		}
 		else if (ch == 'n') {
 			(void) signal(SIGINT, intr);

Index: src/games/hunt/hunt/playit.c
diff -u src/games/hunt/hunt/playit.c:1.9 src/games/hunt/hunt/playit.c:1.10
--- src/games/hunt/hunt/playit.c:1.9	Mon Jan 28 03:23:29 2008
+++ src/games/hunt/hunt/playit.c	Sat Jul  4 01:23:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: playit.c,v 1.9 2008/01/28 03:23:29 dholland Exp $	*/
+/*	$NetBSD: playit.c,v 1.10 2009/07/04 01:23:55 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: playit.c,v 1.9 2008/01/28 03:23:29 dholland Exp $");
+__RCSID("$NetBSD: playit.c,v 1.10 2009/07/04 01:23:55 dholland Exp $");
 #endif /* not lint */
 
 # include	<sys/file.h>
@@ -109,7 +109,7 @@
 	int		y, x;
 	u_int32_t	version;
 
-	if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) {
+	if (read(Socket, &version, LONGLEN) != LONGLEN) {
 		bad_con();
 		/* NOTREACHED */
 	}
@@ -644,7 +644,7 @@
 {
 	u_int32_t	version;
 
-	if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) {
+	if (read(Socket, &version, LONGLEN) != LONGLEN) {
 		bad_con();
 		/* NOTREACHED */
 	}

Reply via email to