Fix warnings.

This commit is contained in:
christos 1997-06-30 22:51:27 +00:00
parent bec3b005c5
commit 5ec7cc78a5
6 changed files with 30 additions and 21 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.24 1997/06/07 00:47:27 perry Exp $
# $NetBSD: Makefile,v 1.25 1997/06/30 22:51:27 christos Exp $
# @(#)Makefile 8.2 (Berkeley) 3/17/94
WARNS= 1
PROG= disklabel
SRCS= disklabel.c dkcksum.c interact.c
MAN= disklabel.5 disklabel.8

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.c,v 1.38 1997/03/16 05:25:38 lukem Exp $ */
/* $NetBSD: disklabel.c,v 1.39 1997/06/30 22:51:29 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@ -36,10 +36,10 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1987, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
@ -47,7 +47,7 @@ static char copyright[] =
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94";
#else
static char rcsid[] = "$NetBSD: disklabel.c,v 1.38 1997/03/16 05:25:38 lukem Exp $";
__RCSID("$NetBSD: disklabel.c,v 1.39 1997/06/30 22:51:29 christos Exp $");
#endif
#endif /* not lint */
@ -70,8 +70,10 @@ static char rcsid[] = "$NetBSD: disklabel.c,v 1.38 1997/03/16 05:25:38 lukem Exp
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "pathnames.h"
#include "extern.h"
#include "dkcksum.h"
/*
* Disklabel: read and write disklabels.
@ -138,7 +140,6 @@ static struct dos_partition *readmbr __P((int));
#endif
int main __P((int, char *[]));
extern u_short dkcksum __P((struct disklabel *));
static void makedisktab __P((FILE *, struct disklabel *));
static void makelabel __P((char *, char *, struct disklabel *));
@ -150,7 +151,9 @@ static int editit __P((void));
static char *skip __P((char *));
static char *word __P((char *));
static int getasciilabel __P((FILE *, struct disklabel *));
#if NUMBOOT > 0
static void setbootflag __P((struct disklabel *));
#endif
static void usage __P((void));
int
@ -338,8 +341,8 @@ main(argc, argv)
error = writelabel(f, bootarea, lp);
break;
#if NUMBOOT > 0
case WRITEBOOT:
#if NUMBOOT > 0
{
struct disklabel tlab;
@ -675,8 +678,8 @@ makebootarea(boot, dp, f)
{
struct disklabel *lp;
char *p;
int b;
#if NUMBOOT > 0
int b;
char *dkbasename;
# if NUMBOOT <= 1
struct stat sb;
@ -809,7 +812,7 @@ makedisktab(f, lp)
struct partition *pp;
(void) fprintf(f, "%.*s|Automatically generated label:\\\n\t:dt=",
sizeof(lp->d_typename), lp->d_typename);
(int) sizeof(lp->d_typename), lp->d_typename);
if ((unsigned) lp->d_type < DKMAXTYPES)
(void) fprintf(f, "%s:", dktypenames[lp->d_type]);
else
@ -903,9 +906,9 @@ display(f, lp)
(void) fprintf(f, "type: %s\n", dktypenames[lp->d_type]);
else
(void) fprintf(f, "type: %d\n", lp->d_type);
(void) fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename),
(void) fprintf(f, "disk: %.*s\n", (int) sizeof(lp->d_typename),
lp->d_typename);
(void) fprintf(f, "label: %.*s\n", sizeof(lp->d_packname),
(void) fprintf(f, "label: %.*s\n", (int) sizeof(lp->d_packname),
lp->d_packname);
(void) fprintf(f, "flags:");
if (lp->d_flags & D_REMOVABLE)

View File

@ -1,4 +1,4 @@
/* $NetBSD: dkcksum.c,v 1.6 1995/03/18 14:54:42 cgd Exp $ */
/* $NetBSD: dkcksum.c,v 1.7 1997/06/30 22:51:31 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -33,16 +33,18 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
#else
static char rcsid[] = "$NetBSD: dkcksum.c,v 1.6 1995/03/18 14:54:42 cgd Exp $";
__RCSID("$NetBSD: dkcksum.c,v 1.7 1997/06/30 22:51:31 christos Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/disklabel.h>
#include "dkcksum.h"
u_short
dkcksum(lp)

1
sbin/disklabel/dkcksum.h Normal file
View File

@ -0,0 +1 @@
u_short dkcksum __P((struct disklabel *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.1 1997/03/08 23:46:11 christos Exp $ */
/* $NetBSD: extern.h,v 1.2 1997/06/30 22:51:33 christos Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@ -32,5 +32,5 @@
int writelabel __P((int, char *, struct disklabel *));
int checklabel __P((struct disklabel *));
void display __P((FILE *, struct disklabel *));
int interac __P((struct disklabel *, int));
void interact __P((struct disklabel *, int));
extern char bootarea[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: interact.c,v 1.4 1997/03/18 21:26:44 christos Exp $ */
/* $NetBSD: interact.c,v 1.5 1997/06/30 22:51:34 christos Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@ -29,8 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char rcsid[] = "$NetBSD: interact.c,v 1.4 1997/03/18 21:26:44 christos Exp $";
__RCSID("$NetBSD: interact.c,v 1.5 1997/06/30 22:51:34 christos Exp $");
#endif /* lint */
#include <stdio.h>
@ -217,7 +218,7 @@ cmd_label(lp, s, fd)
}
if ((i = writelabel(fd, bootarea, lp)) != 0) {
printf("Label not written %d\n", strerror(i));
printf("Label not written %s\n", strerror(i));
return;
}
printf("Label written\n");
@ -237,16 +238,17 @@ runcmd(line, lp, fd)
if (cmd->func == NULL)
return -1;
(*cmd->func)(lp, line, fd);
return;
return 0;
}
if (line[1] == '\0' &&
line[0] >= 'a' && line[0] < 'a' + getmaxpartitions()) {
cmd_part(lp, line, fd);
return;
return 0;
}
printf("Unknown command %s\n", line);
return 1;
}