Remove a pile of bogus casts. One object file diff, crosschecked and
found harmless.
This commit is contained in:
parent
1d5d8311da
commit
6ffae66268
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: answer.c,v 1.11 2009/06/28 21:12:35 dholland Exp $ */
|
||||
/* $NetBSD: answer.c,v 1.12 2009/07/04 01:01:18 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: answer.c,v 1.11 2009/06/28 21:12:35 dholland Exp $");
|
||||
__RCSID("$NetBSD: answer.c,v 1.12 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <ctype.h>
|
||||
|
@ -90,15 +90,15 @@ answer()
|
|||
machine = gethostid();
|
||||
# endif
|
||||
version = htonl((u_int32_t) HUNT_VERSION);
|
||||
(void) write(newsock, (char *) &version, LONGLEN);
|
||||
(void) read(newsock, (char *) &uid, LONGLEN);
|
||||
(void) write(newsock, &version, LONGLEN);
|
||||
(void) read(newsock, &uid, LONGLEN);
|
||||
uid = ntohl(uid);
|
||||
(void) read(newsock, name, NAMELEN);
|
||||
(void) read(newsock, &team, 1);
|
||||
(void) read(newsock, (char *) &enter_status, LONGLEN);
|
||||
(void) read(newsock, &enter_status, LONGLEN);
|
||||
enter_status = ntohl((unsigned long) enter_status);
|
||||
(void) read(newsock, Ttyname, NAMELEN);
|
||||
(void) read(newsock, (char *) &mode, sizeof mode);
|
||||
(void) read(newsock, &mode, sizeof mode);
|
||||
mode = ntohl(mode);
|
||||
|
||||
/*
|
||||
|
@ -161,7 +161,7 @@ answer()
|
|||
i = pp - Monitor + MAXPL + 3;
|
||||
} else {
|
||||
socklen = 0;
|
||||
(void) write(newsock, (char *) &socklen,
|
||||
(void) write(newsock, &socklen,
|
||||
sizeof socklen);
|
||||
(void) close(newsock);
|
||||
return FALSE;
|
||||
|
@ -173,7 +173,7 @@ answer()
|
|||
i = pp - Player + 3;
|
||||
} else {
|
||||
socklen = 0;
|
||||
(void) write(newsock, (char *) &socklen,
|
||||
(void) write(newsock, &socklen,
|
||||
sizeof socklen);
|
||||
(void) close(newsock);
|
||||
return FALSE;
|
||||
|
@ -409,7 +409,7 @@ get_ident(machine, uid, name, team)
|
|||
ip->i_score = ip->i_kills / (double) ip->i_entries;
|
||||
}
|
||||
else {
|
||||
ip = (IDENT *) malloc(sizeof (IDENT));
|
||||
ip = malloc(sizeof(*ip));
|
||||
if (ip == NULL) {
|
||||
/* Fourth down, time to punt */
|
||||
ip = &punt;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ctl_transact.c,v 1.6 2003/06/11 12:00:22 wiz Exp $ */
|
||||
/* $NetBSD: ctl_transact.c,v 1.7 2009/07/04 01:01:18 dholland Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1983-2003, Regents of the University of California.
|
||||
* All rights reserved.
|
||||
|
@ -39,7 +39,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ctl_transact.c 5.2 (Berkeley) 3/13/86";
|
||||
#else
|
||||
__RCSID("$NetBSD: ctl_transact.c,v 1.6 2003/06/11 12:00:22 wiz Exp $");
|
||||
__RCSID("$NetBSD: ctl_transact.c,v 1.7 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -80,7 +80,7 @@ ctl_transact(target, msg, type, rp)
|
|||
do {
|
||||
/* resend message until a response is obtained */
|
||||
for (retries = MAX_RETRY; retries > 0; retries -= 1) {
|
||||
cc = sendto(ctl_sockt, (char *)&msg, sizeof (msg), 0,
|
||||
cc = sendto(ctl_sockt, &msg, sizeof (msg), 0,
|
||||
&daemon_addr, sizeof (daemon_addr));
|
||||
if (cc != sizeof (msg)) {
|
||||
if (errno == EINTR)
|
||||
|
@ -104,7 +104,7 @@ ctl_transact(target, msg, type, rp)
|
|||
* request/acknowledgements being sent)
|
||||
*/
|
||||
do {
|
||||
cc = recv(ctl_sockt, (char *)rp, sizeof (*rp), 0);
|
||||
cc = recv(ctl_sockt, rp, sizeof (*rp), 0);
|
||||
if (cc < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: driver.c,v 1.14 2009/06/28 21:12:35 dholland Exp $ */
|
||||
/* $NetBSD: driver.c,v 1.15 2009/07/04 01:01:18 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: driver.c,v 1.14 2009/06/28 21:12:35 dholland Exp $");
|
||||
__RCSID("$NetBSD: driver.c,v 1.15 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <sys/ioctl.h>
|
||||
|
@ -145,20 +145,20 @@ again:
|
|||
if (fdset[2].revents & POLLIN) {
|
||||
namelen = DAEMON_SIZE;
|
||||
port_num = htons(sock_port);
|
||||
(void) recvfrom(Test_socket, (char *) &msg, sizeof msg,
|
||||
(void) recvfrom(Test_socket, &msg, sizeof msg,
|
||||
0, (struct sockaddr *) &test, &namelen);
|
||||
switch (ntohs(msg)) {
|
||||
case C_MESSAGE:
|
||||
if (Nplayer <= 0)
|
||||
break;
|
||||
reply = htons((u_short) Nplayer);
|
||||
(void) sendto(Test_socket, (char *) &reply,
|
||||
(void) sendto(Test_socket, &reply,
|
||||
sizeof reply, 0,
|
||||
(struct sockaddr *) &test, DAEMON_SIZE);
|
||||
break;
|
||||
case C_SCORES:
|
||||
reply = htons(stat_port);
|
||||
(void) sendto(Test_socket, (char *) &reply,
|
||||
(void) sendto(Test_socket, &reply,
|
||||
sizeof reply, 0,
|
||||
(struct sockaddr *) &test, DAEMON_SIZE);
|
||||
break;
|
||||
|
@ -167,7 +167,7 @@ again:
|
|||
if (msg == C_MONITOR && Nplayer <= 0)
|
||||
break;
|
||||
reply = htons(sock_port);
|
||||
(void) sendto(Test_socket, (char *) &reply,
|
||||
(void) sendto(Test_socket, &reply,
|
||||
sizeof reply, 0,
|
||||
(struct sockaddr *) &test, DAEMON_SIZE);
|
||||
break;
|
||||
|
@ -977,7 +977,7 @@ clear_scores()
|
|||
|
||||
for (ip = Scores; ip != NULL; ip = nextip) {
|
||||
nextip = ip->i_next;
|
||||
(void) free((char *) ip);
|
||||
(void) free(ip);
|
||||
}
|
||||
Scores = NULL;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: execute.c,v 1.6 2009/06/28 21:12:35 dholland Exp $ */
|
||||
/* $NetBSD: execute.c,v 1.7 2009/07/04 01:01:18 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: execute.c,v 1.6 2009/06/28 21:12:35 dholland Exp $");
|
||||
__RCSID("$NetBSD: execute.c,v 1.7 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <stdlib.h>
|
||||
|
@ -496,7 +496,7 @@ create_shot(type, y, x, face, charge, size, owner, score, expl, over)
|
|||
{
|
||||
BULLET *bp;
|
||||
|
||||
bp = (BULLET *) malloc(sizeof (BULLET)); /* NOSTRICT */
|
||||
bp = malloc(sizeof(*bp));
|
||||
if (bp == NULL) {
|
||||
if (owner != NULL)
|
||||
message(owner, "Out of memory");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: expl.c,v 1.4 2004/01/27 20:30:29 jsm Exp $ */
|
||||
/* $NetBSD: expl.c,v 1.5 2009/07/04 01:01:18 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: expl.c,v 1.4 2004/01/27 20:30:29 jsm Exp $");
|
||||
__RCSID("$NetBSD: expl.c,v 1.5 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <stdlib.h>
|
||||
|
@ -57,7 +57,7 @@ showexpl(y, x, type)
|
|||
return;
|
||||
if (x < 0 || x >= WIDTH)
|
||||
return;
|
||||
ep = (EXPL *) malloc(sizeof (EXPL)); /* NOSTRICT */
|
||||
ep = malloc(sizeof(*ep));
|
||||
ep->e_y = y;
|
||||
ep->e_x = x;
|
||||
ep->e_char = type;
|
||||
|
@ -132,7 +132,7 @@ rollexpl()
|
|||
for (pp = Monitor; pp < End_monitor; pp++)
|
||||
check(pp, y, x);
|
||||
# endif
|
||||
free((char *) ep);
|
||||
free(ep);
|
||||
}
|
||||
for (x = EXPLEN - 1; x > 0; x--)
|
||||
Expl[x] = Expl[x - 1];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: faketalk.c,v 1.12 2009/06/28 21:12:35 dholland Exp $ */
|
||||
/* $NetBSD: faketalk.c,v 1.13 2009/07/04 01:01:18 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: faketalk.c,v 1.12 2009/06/28 21:12:35 dholland Exp $");
|
||||
__RCSID("$NetBSD: faketalk.c,v 1.13 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "bsd.h"
|
||||
|
@ -123,7 +123,7 @@ faketalk()
|
|||
* start fetching addresses
|
||||
*/
|
||||
|
||||
if ((sp = getservbyname("smtp", (char *) NULL)) == NULL) {
|
||||
if ((sp = getservbyname("smtp", NULL)) == NULL) {
|
||||
# ifdef LOG
|
||||
syslog(LOG_ERR, "faketalk: smtp protocol not supported\n");
|
||||
# else
|
||||
|
@ -239,7 +239,7 @@ do_announce(s)
|
|||
msg.type = DELETE;
|
||||
msg.id_num = (int) htonl(response.id_num);
|
||||
daemon_addr.sin_addr = his_machine_addr;
|
||||
if (sendto(ctl_sockt, (char *) &msg, sizeof (msg), 0,
|
||||
if (sendto(ctl_sockt, &msg, sizeof (msg), 0,
|
||||
(struct sockaddr *) &daemon_addr, sizeof(daemon_addr))
|
||||
!= sizeof(msg))
|
||||
p_error("send delete remote");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: get_names.c,v 1.7 2003/06/11 12:00:22 wiz Exp $ */
|
||||
/* $NetBSD: get_names.c,v 1.8 2009/07/04 01:01:18 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: get_names.c,v 1.7 2003/06/11 12:00:22 wiz Exp $");
|
||||
__RCSID("$NetBSD: get_names.c,v 1.8 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "bsd.h"
|
||||
|
@ -146,7 +146,7 @@ get_remote_name(his_address)
|
|||
msg.r_name[NAME_SIZE - 1] = '\0';
|
||||
|
||||
/* if he is on the same machine, then simply copy */
|
||||
if (memcmp((char *) &his_machine_name, (char *) &my_machine_name,
|
||||
if (memcmp(&his_machine_name, &my_machine_name,
|
||||
sizeof(his_machine_name)) == 0)
|
||||
memcpy(&his_machine_addr, &my_machine_addr,
|
||||
sizeof(his_machine_name));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: shots.c,v 1.7 2009/06/28 21:12:35 dholland Exp $ */
|
||||
/* $NetBSD: shots.c,v 1.8 2009/07/04 01:01:18 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: shots.c,v 1.7 2009/06/28 21:12:35 dholland Exp $");
|
||||
__RCSID("$NetBSD: shots.c,v 1.8 2009/07/04 01:01:18 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
# include <err.h>
|
||||
|
@ -149,7 +149,7 @@ moveshots()
|
|||
}
|
||||
|
||||
chkshot(bp, next);
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
}
|
||||
|
||||
for (pp = Player; pp < End_player; pp++)
|
||||
|
@ -315,7 +315,7 @@ move_normal_shot(bp)
|
|||
pp->p_ident->i_saved++;
|
||||
message(pp, "Absorbed charge (good shield!)");
|
||||
pp->p_ident->i_absorbed += bp->b_charge;
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
(void) snprintf(Buf, sizeof(Buf),
|
||||
"%3d", pp->p_ammo);
|
||||
cgoto(pp, STAT_AMMO_ROW, STAT_VALUE_COL);
|
||||
|
@ -497,7 +497,7 @@ drone_move:
|
|||
pp = play_at(bp->b_y, bp->b_x);
|
||||
pp->p_ammo += bp->b_charge;
|
||||
message(pp, "**** Absorbed drone ****");
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
(void) snprintf(Buf, sizeof(buf), "%3d", pp->p_ammo);
|
||||
cgoto(pp, STAT_AMMO_ROW, STAT_VALUE_COL);
|
||||
outstr(pp, Buf, 3);
|
||||
|
@ -785,7 +785,7 @@ chkslime(bp, next)
|
|||
}
|
||||
break;
|
||||
}
|
||||
nbp = (BULLET *) malloc(sizeof (BULLET));
|
||||
nbp = malloc(sizeof(*nbp));
|
||||
*nbp = *bp;
|
||||
# ifdef VOLCANO
|
||||
move_slime(nbp, nbp->b_type == SLIME ? SLIMESPEED : LAVASPEED, next);
|
||||
|
@ -811,7 +811,7 @@ move_slime(bp, speed, next)
|
|||
|
||||
if (speed == 0) {
|
||||
if (bp->b_charge <= 0)
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
else
|
||||
save_bullet(bp);
|
||||
return;
|
||||
|
@ -847,7 +847,7 @@ move_slime(bp, speed, next)
|
|||
}
|
||||
|
||||
if (--bp->b_charge <= 0) {
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -952,7 +952,7 @@ move_slime(bp, speed, next)
|
|||
move_slime(nbp, speed - 1, next);
|
||||
}
|
||||
|
||||
free((char *) bp);
|
||||
free(bp);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue