From f7c9c96acb3c363bbf0daf9cf36637f9e37b3486 Mon Sep 17 00:00:00 2001 From: xtraeme Date: Wed, 16 Mar 2005 01:34:11 +0000 Subject: [PATCH] Use ANSI function declarations, constify; WARNS=3 --- usr.sbin/wsfontload/Makefile | 4 +++- usr.sbin/wsfontload/wsfontload.c | 36 +++++++++++++------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/usr.sbin/wsfontload/Makefile b/usr.sbin/wsfontload/Makefile index a99371641dd9..3d950326e9d9 100644 --- a/usr.sbin/wsfontload/Makefile +++ b/usr.sbin/wsfontload/Makefile @@ -1,7 +1,9 @@ -# $NetBSD: Makefile,v 1.1 1999/01/13 19:02:34 drochner Exp $ +# $NetBSD: Makefile,v 1.2 2005/03/16 01:34:11 xtraeme Exp $ PROG= wsfontload MAN= wsfontload.8 SRCS= wsfontload.c +WARNS= 3 + .include diff --git a/usr.sbin/wsfontload/wsfontload.c b/usr.sbin/wsfontload/wsfontload.c index d8d1aa3bc36e..d4b8e28ee60c 100644 --- a/usr.sbin/wsfontload/wsfontload.c +++ b/usr.sbin/wsfontload/wsfontload.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsfontload.c,v 1.9 2004/01/05 23:23:39 jmmv Exp $ */ +/* $NetBSD: wsfontload.c,v 1.10 2005/03/16 01:34:11 xtraeme Exp $ */ /* * Copyright (c) 1999 @@ -51,14 +51,13 @@ #define DEFBITORDER WSDISPLAY_FONTORDER_L2R #define DEFBYTEORDER WSDISPLAY_FONTORDER_L2R -int main __P((int, char**)); -static void usage __P((void)); -static int getencoding __P((char *)); -static char *rgetencoding __P((int)); -static char *rgetfontorder __P((int)); +static void usage(void); +static int getencoding(char *); +static const char *rgetencoding(int); +static const char *rgetfontorder(int); static struct { - char *name; + const char *name; int val; } fontorders[] = { { "known", WSDISPLAY_FONTORDER_KNOWN}, @@ -67,7 +66,7 @@ static struct { }; static struct { - char *name; + const char *name; int val; } encodings[] = { {"iso", WSDISPLAY_FONTENC_ISO}, @@ -78,7 +77,7 @@ static struct { }; static void -usage() +usage(void) { (void)fprintf(stderr, @@ -91,9 +90,8 @@ usage() /* * map given fontorder to it's string representation */ -static char * -rgetfontorder(fontorder) - int fontorder; +static const char * +rgetfontorder(int fontorder) { int i; @@ -107,9 +105,8 @@ rgetfontorder(fontorder) /* * map given encoding to it's string representation */ -static char * -rgetencoding(enc) - int enc; +static const char * +rgetencoding(int enc) { int i; @@ -124,8 +121,7 @@ rgetencoding(enc) * map given encoding string to integer value */ static int -getencoding(name) - char *name; +getencoding(char *name) { int i; @@ -139,11 +135,9 @@ getencoding(name) } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { - char *wsdev; + const char *wsdev; struct wsdisplay_font f; int c, res, wsfd, ffd, verbose = 0; size_t len;