From 458c440612e1d5d8ad36c7d3ab6f4a0a9e99aa93 Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 14 Mar 2009 18:41:21 +0000 Subject: [PATCH] Remove some unnecessary casts. --- sail/lo_main.c | 8 ++++---- sail/misc.c | 12 ++++++------ sail/pl_main.c | 8 ++++---- sail/sync.c | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sail/lo_main.c b/sail/lo_main.c index 7a3df13a..c86daf7a 100644 --- a/sail/lo_main.c +++ b/sail/lo_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: lo_main.c,v 1.14 2009/03/14 18:32:47 dholland Exp $ */ +/* $NetBSD: lo_main.c,v 1.15 2009/03/14 18:41:21 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)lo_main.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: lo_main.c,v 1.14 2009/03/14 18:32:47 dholland Exp $"); +__RCSID("$NetBSD: lo_main.c,v 1.15 2009/03/14 18:41:21 dholland Exp $"); #endif #endif /* not lint */ @@ -70,7 +70,7 @@ lo_main(void) perror(_PATH_LOGFILE); exit(1); } - switch (fread((char *)&npeople, sizeof npeople, 1, fp)) { + switch (fread(&npeople, sizeof npeople, 1, fp)) { case 0: printf("Nobody has sailed yet.\n"); exit(0); @@ -80,7 +80,7 @@ lo_main(void) perror(_PATH_LOGFILE); exit(1); } - while (fread((char *)&log, sizeof log, 1, fp) == 1 && + while (fread(&log, sizeof log, 1, fp) == 1 && log.l_name[0] != '\0') { if (longfmt && (pass = getpwuid(log.l_uid)) != NULL) snprintf(sbuf, sizeof(sbuf), diff --git a/sail/misc.c b/sail/misc.c index 5367e02a..d1034277 100644 --- a/sail/misc.c +++ b/sail/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.16 2008/01/28 01:58:01 dholland Exp $ */ +/* $NetBSD: misc.c,v 1.17 2009/03/14 18:41:21 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: misc.c,v 1.16 2008/01/28 01:58:01 dholland Exp $"); +__RCSID("$NetBSD: misc.c,v 1.17 2009/03/14 18:41:21 dholland Exp $"); #endif #endif /* not lint */ @@ -213,7 +213,7 @@ logger(struct ship *s) #endif net = (float)s->file->points / s->specs->pts; persons = getw(fp); - n = fread((char *)log, sizeof(struct logs), NLOG, fp); + n = fread(log, sizeof(struct logs), NLOG, fp); for (lp = &log[n]; lp < &log[NLOG]; lp++) lp->l_name[0] = lp->l_uid = lp->l_shipnum = lp->l_gamenum = lp->l_netpoints = 0; @@ -225,14 +225,14 @@ logger(struct ship *s) for (lp = log; lp < &log[NLOG]; lp++) if (net > (float)lp->l_netpoints / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) { - fwrite((char *)log, sizeof (struct logs), lp - log, fp); + fwrite(log, sizeof (struct logs), lp - log, fp); strcpy(log[NLOG-1].l_name, s->file->captain); log[NLOG-1].l_uid = getuid(); log[NLOG-1].l_shipnum = s->file->index; log[NLOG-1].l_gamenum = game; log[NLOG-1].l_netpoints = s->file->points; - fwrite((char *)&log[NLOG-1], sizeof (struct logs), 1, fp); - fwrite((char *)lp, sizeof (struct logs), &log[NLOG-1] - lp, fp); + fwrite(&log[NLOG-1], sizeof (struct logs), 1, fp); + fwrite(lp, sizeof (struct logs), &log[NLOG-1] - lp, fp); break; } #ifdef LOCK_EX diff --git a/sail/pl_main.c b/sail/pl_main.c index 6d068010..946907b1 100644 --- a/sail/pl_main.c +++ b/sail/pl_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_main.c,v 1.20 2009/03/14 18:32:47 dholland Exp $ */ +/* $NetBSD: pl_main.c,v 1.21 2009/03/14 18:41:21 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_main.c,v 1.20 2009/03/14 18:32:47 dholland Exp $"); +__RCSID("$NetBSD: pl_main.c,v 1.21 2009/03/14 18:41:21 dholland Exp $"); #endif #endif /* not lint */ @@ -134,7 +134,7 @@ reprint: if (sp >= ls) { puts("All ships taken in that scenario."); foreachship(sp) - free((char *)sp->file); + free(sp->file); sync_close(0); people = 0; goto reprint; @@ -202,7 +202,7 @@ reprint: printf("Your ship is the %s, a %d gun %s (%s crew).\n", ms->shipname, mc->guns, classname[mc->class], qualname[mc->qual]); - if ((nameptr = (char *) getenv("SAILNAME")) && *nameptr) + if ((nameptr = getenv("SAILNAME")) && *nameptr) strlcpy(captain, nameptr, sizeof captain); else { printf("Your name, Captain? "); diff --git a/sail/sync.c b/sail/sync.c index b813a7c6..a754ffb3 100644 --- a/sail/sync.c +++ b/sail/sync.c @@ -1,4 +1,4 @@ -/* $NetBSD: sync.c,v 1.26 2009/03/14 18:32:47 dholland Exp $ */ +/* $NetBSD: sync.c,v 1.27 2009/03/14 18:41:21 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sync.c,v 1.26 2009/03/14 18:32:47 dholland Exp $"); +__RCSID("$NetBSD: sync.c,v 1.27 2009/03/14 18:41:21 dholland Exp $"); #endif #endif /* not lint */ @@ -259,7 +259,7 @@ Sync(void) for (p = buf;;) { ch = getc(sync_fp); - *p++ = (char)ch; + *p++ = ch; switch (ch) { case '\n': p--; -- 2.47.1