kill bad casts

This commit is contained in:
cgd 1994-03-30 02:28:43 +00:00
parent 468f4334b4
commit 7a6e889600
5 changed files with 13 additions and 13 deletions

View File

@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)edquota.c 5.15 (Berkeley) 9/27/90";*/ /*static char sccsid[] = "from: @(#)edquota.c 5.15 (Berkeley) 9/27/90";*/
static char rcsid[] = "$Id: edquota.c,v 1.2 1993/08/01 17:59:53 mycroft Exp $"; static char rcsid[] = "$Id: edquota.c,v 1.3 1994/03/30 02:28:43 cgd Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -249,7 +249,7 @@ getprivs(id, quotatype)
getentry(quotagroup, GRPQUOTA)); getentry(quotagroup, GRPQUOTA));
(void) fchmod(fd, 0640); (void) fchmod(fd, 0640);
} }
lseek(fd, (long)(id * sizeof(struct dqblk)), L_SET); lseek(fd, id * sizeof(struct dqblk), L_SET);
switch (read(fd, &qup->dqblk, sizeof(struct dqblk))) { switch (read(fd, &qup->dqblk, sizeof(struct dqblk))) {
case 0: /* EOF */ case 0: /* EOF */
/* /*
@ -303,7 +303,7 @@ putprivs(id, quotatype, quplist)
if ((fd = open(qup->qfname, O_WRONLY)) < 0) { if ((fd = open(qup->qfname, O_WRONLY)) < 0) {
perror(qup->qfname); perror(qup->qfname);
} else { } else {
lseek(fd, (long)id * (long)sizeof (struct dqblk), 0); lseek(fd, id * sizeof (struct dqblk), 0);
if (write(fd, &qup->dqblk, sizeof (struct dqblk)) != if (write(fd, &qup->dqblk, sizeof (struct dqblk)) !=
sizeof (struct dqblk)) { sizeof (struct dqblk)) {
fprintf(stderr, "edquota: "); fprintf(stderr, "edquota: ");

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)kgmon.c 5.12 (Berkeley) 7/1/91";*/ /*static char sccsid[] = "from: @(#)kgmon.c 5.12 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: kgmon.c,v 1.2 1993/08/01 17:59:25 mycroft Exp $"; static char rcsid[] = "$Id: kgmon.c,v 1.3 1994/03/30 02:32:15 cgd Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -61,7 +61,7 @@ static char rcsid[] = "$Id: kgmon.c,v 1.2 1993/08/01 17:59:25 mycroft Exp $";
#define PROFILING_OFF 3 #define PROFILING_OFF 3
u_long s_textsize; u_long s_textsize;
off_t sbuf, klseek(), lseek(); off_t sbuf, klseek __P((int, off_t, int));
int ssiz; int ssiz;
struct nlist nl[] = { struct nlist nl[] = {
@ -322,7 +322,7 @@ resetstate()
turnonoff(onoff) turnonoff(onoff)
int onoff; int onoff;
{ {
(void)klseek(kmem, (long)nl[N_PROFILING].n_value, L_SET); (void)klseek(kmem, (off_t)nl[N_PROFILING].n_value, L_SET);
(void)write(kmem, (char *)&onoff, sizeof (onoff)); (void)write(kmem, (char *)&onoff, sizeof (onoff));
} }

View File

@ -26,7 +26,7 @@ char copyright[] =
#ifndef lint #ifndef lint
static char rcsid[] = static char rcsid[] =
"@(#) $Id: rarpd.c,v 1.4 1994/03/01 06:46:42 cgd Exp $"; "@(#) $Id: rarpd.c,v 1.5 1994/03/30 02:32:50 cgd Exp $";
#endif #endif
@ -422,7 +422,7 @@ rarp_loop()
* lseek() to 0 will fix things. */ * lseek() to 0 will fix things. */
if (cc < 0) { if (cc < 0) {
if (errno == EINVAL && if (errno == EINVAL &&
(long) (lseek(fd, 0L, SEEK_CUR) + bufsize) < 0) { (lseek(fd, 0, SEEK_CUR) + bufsize) < 0) {
(void) lseek(fd, 0, 0); (void) lseek(fd, 0, 0);
goto again; goto again;
} }

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)rmt.c 5.6 (Berkeley) 6/1/90";*/ /*static char sccsid[] = "from: @(#)rmt.c 5.6 (Berkeley) 6/1/90";*/
static char rcsid[] = "$Id: rmt.c,v 1.3 1994/03/28 07:08:56 cgd Exp $"; static char rcsid[] = "$Id: rmt.c,v 1.4 1994/03/30 02:33:23 cgd Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -113,7 +113,7 @@ top:
case 'L': case 'L':
getstring(count); getstring(pos); getstring(count); getstring(pos);
DEBUG2("rmtd: L %s %s\n", count, pos); DEBUG2("rmtd: L %s %s\n", count, pos);
rval = lseek(tape, (long) atoi(count), atoi(pos)); rval = lseek(tape, atoi(count), atoi(pos));
if (rval < 0) if (rval < 0)
goto ioerror; goto ioerror;
goto respond; goto respond;

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)rwhod.c 5.20 (Berkeley) 3/2/91";*/ /*static char sccsid[] = "from: @(#)rwhod.c 5.20 (Berkeley) 3/2/91";*/
static char rcsid[] = "$Id: rwhod.c,v 1.5 1994/03/28 07:10:40 cgd Exp $"; static char rcsid[] = "$Id: rwhod.c,v 1.6 1994/03/30 02:34:03 cgd Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -281,7 +281,7 @@ onalrm()
goto done; goto done;
} }
} }
(void) lseek(utmpf, (long)0, L_SET); (void) lseek(utmpf, 0, L_SET);
cc = read(utmpf, (char *)utmp, stb.st_size); cc = read(utmpf, (char *)utmp, stb.st_size);
if (cc < 0) { if (cc < 0) {
fprintf(stderr, "rwhod: %s: %s\n", fprintf(stderr, "rwhod: %s: %s\n",
@ -366,7 +366,7 @@ loop:
syslog(LOG_ERR, "%s: %m", _PATH_KMEM); syslog(LOG_ERR, "%s: %m", _PATH_KMEM);
exit(1); exit(1);
} }
(void) lseek(kmemf, (long)nl[NL_BOOTTIME].n_value, L_SET); (void) lseek(kmemf, nl[NL_BOOTTIME].n_value, L_SET);
(void) read(kmemf, (char *)&mywd.wd_boottime, (void) read(kmemf, (char *)&mywd.wd_boottime,
sizeof (mywd.wd_boottime)); sizeof (mywd.wd_boottime));
mywd.wd_boottime = htonl(mywd.wd_boottime); mywd.wd_boottime = htonl(mywd.wd_boottime);