summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-10-23 09:23:17 +0000
committerru <ru@FreeBSD.org>2001-10-23 09:23:17 +0000
commitfab1e5731d72a87425d0c3c01481a8f421493e37 (patch)
treeca50f8356d8ce24168074e366574556903df28ba /sbin
parent2d213e18a00ff6e4ec5aefc14cc54fb1941a66ed (diff)
downloadFreeBSD-src-fab1e5731d72a87425d0c3c01481a8f421493e37.zip
FreeBSD-src-fab1e5731d72a87425d0c3c01481a8f421493e37.tar.gz
WARNSify.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/cxconfig/Makefile1
-rw-r--r--sbin/cxconfig/cxconfig.c71
-rw-r--r--sbin/i386/cxconfig/Makefile1
-rw-r--r--sbin/i386/cxconfig/cxconfig.c71
4 files changed, 94 insertions, 50 deletions
diff --git a/sbin/cxconfig/Makefile b/sbin/cxconfig/Makefile
index e851ec9..49c493e 100644
--- a/sbin/cxconfig/Makefile
+++ b/sbin/cxconfig/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
PROG= cxconfig
+WARNS?= 2
MAN= cxconfig.8
.include <bsd.prog.mk>
diff --git a/sbin/cxconfig/cxconfig.c b/sbin/cxconfig/cxconfig.c
index 3ae000d..1a5ca48 100644
--- a/sbin/cxconfig/cxconfig.c
+++ b/sbin/cxconfig/cxconfig.c
@@ -27,13 +27,14 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <err.h>
-#include <fcntl.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <machine/cronyx.h>
+#include <sys/socket.h>
#include <net/if.h>
+#include <machine/cronyx.h>
+
+#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -48,7 +49,8 @@ cx_stat_t st;
int aflag;
int sflag;
-char *symbol (unsigned char sym)
+static char *
+symbol(unsigned char sym)
{
static char buf[40];
@@ -63,7 +65,8 @@ char *symbol (unsigned char sym)
return (buf);
}
-unsigned char atosym (char *s)
+static unsigned char
+atosym(char *s)
{
if (*s == '^')
return (*++s & 037);
@@ -72,7 +75,8 @@ unsigned char atosym (char *s)
return (*s);
}
-void usage ()
+static void
+usage(void)
{
fprintf (stderr,
"Cronyx-Sigma Adapter Configuration Utility, Version 1.0\n");
@@ -81,9 +85,11 @@ void usage ()
exit (1);
}
-char *chantype (int type)
+static const char *
+chantype(int type)
{
switch (type) {
+ default:
case T_NONE: return ("none");
case T_ASYNC: return ("RS-232");
case T_UNIV_RS232: return ("RS-232");
@@ -95,7 +101,8 @@ char *chantype (int type)
}
}
-char *chanmode (int mode)
+static const char *
+chanmode(int mode)
{
switch (mode) {
case M_ASYNC: return ("Async");
@@ -106,7 +113,8 @@ char *chanmode (int mode)
}
}
-void getchan (int channel)
+static void
+getchan(int channel)
{
int s = open (CXDEV, 0);
if (s < 0)
@@ -121,7 +129,8 @@ void getchan (int channel)
o.channel);
}
-int printstats (int channel, int hflag)
+static int
+printstats(int channel, int hflag)
{
int s, res;
@@ -143,7 +152,8 @@ int printstats (int channel, int hflag)
return (0);
}
-void printallstats ()
+static void
+printallstats(void)
{
int b, c;
@@ -153,7 +163,8 @@ void printallstats ()
printstats (b*NCHAN + c, 0);
}
-void setchan (int channel)
+static void
+setchan(int channel)
{
int s = open (CXDEV, 0);
if (s < 0)
@@ -165,7 +176,8 @@ void setchan (int channel)
close (s);
}
-void printopt ()
+static void
+printopt(void)
{
/* Common channel options */
/* channel option register 4 */
@@ -376,13 +388,14 @@ void printopt ()
}
}
-void printchan (int channel)
+static void
+printchan(int channel)
{
printf ("cx%d (%s) %s", channel, chantype (o.type), chanmode (o.mode));
if (o.txbaud == o.rxbaud)
- printf (" %d", o.rxbaud);
+ printf (" %lu", o.rxbaud);
else
- printf (" ospeed=%d ispeed=%d", o.txbaud, o.rxbaud);
+ printf (" ospeed=%lu ispeed=%lu", o.txbaud, o.rxbaud);
if ((o.channel == 0 || o.channel == 8) &&
(o.type == T_UNIV_V35 || o.type == T_UNIV_RS449))
printf (" port=%s", o.iftype ? (o.type == T_UNIV_V35 ?
@@ -397,7 +410,8 @@ void printchan (int channel)
printopt ();
}
-void printall ()
+static void
+printall(void)
{
struct ifconf ifc;
struct ifreq *ifr;
@@ -435,7 +449,8 @@ void printall ()
close (s);
}
-void set_interface_type (char *type)
+static void
+set_interface_type(char *type)
{
if (o.channel != 0 && o.channel != 8) {
printf ("interface option is applicable only for channels 0 and 8\n");
@@ -451,7 +466,8 @@ void set_interface_type (char *type)
o.iftype = 1;
}
-void set_master (char *ifname)
+static void
+set_master(char *ifname)
{
if (o.type == T_ASYNC) {
printf ("master option is not applicable for async channels\n");
@@ -460,7 +476,8 @@ void set_master (char *ifname)
strcpy (o.master, ifname);
}
-void set_async_opt (char *opt)
+static void
+set_async_opt(char *opt)
{
/* channel option register 1 */
if (! strncasecmp (opt, "cs", 2)) o.aopt.cor1.charlen = atoi (opt + 2) - 1;
@@ -539,7 +556,8 @@ void set_async_opt (char *opt)
usage ();
}
-void set_hdlc_opt (char *opt)
+static void
+set_hdlc_opt(char *opt)
{
/* hdlc channel option register 1 */
if (! strncasecmp (opt, "if", 2)) o.hopt.cor1.ifflags = atoi (opt + 2);
@@ -585,17 +603,20 @@ void set_hdlc_opt (char *opt)
else usage ();
}
-void set_bisync_opt (char *opt)
+static void
+set_bisync_opt(char *opt __unused)
{
usage ();
}
-void set_x21_opt (char *opt)
+static void
+set_x21_opt(char *opt __unused)
{
usage ();
}
-int main (int argc, char **argv)
+int
+main(int argc, char **argv)
{
int channel;
diff --git a/sbin/i386/cxconfig/Makefile b/sbin/i386/cxconfig/Makefile
index e851ec9..49c493e 100644
--- a/sbin/i386/cxconfig/Makefile
+++ b/sbin/i386/cxconfig/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
PROG= cxconfig
+WARNS?= 2
MAN= cxconfig.8
.include <bsd.prog.mk>
diff --git a/sbin/i386/cxconfig/cxconfig.c b/sbin/i386/cxconfig/cxconfig.c
index 3ae000d..1a5ca48 100644
--- a/sbin/i386/cxconfig/cxconfig.c
+++ b/sbin/i386/cxconfig/cxconfig.c
@@ -27,13 +27,14 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <err.h>
-#include <fcntl.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <machine/cronyx.h>
+#include <sys/socket.h>
#include <net/if.h>
+#include <machine/cronyx.h>
+
+#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -48,7 +49,8 @@ cx_stat_t st;
int aflag;
int sflag;
-char *symbol (unsigned char sym)
+static char *
+symbol(unsigned char sym)
{
static char buf[40];
@@ -63,7 +65,8 @@ char *symbol (unsigned char sym)
return (buf);
}
-unsigned char atosym (char *s)
+static unsigned char
+atosym(char *s)
{
if (*s == '^')
return (*++s & 037);
@@ -72,7 +75,8 @@ unsigned char atosym (char *s)
return (*s);
}
-void usage ()
+static void
+usage(void)
{
fprintf (stderr,
"Cronyx-Sigma Adapter Configuration Utility, Version 1.0\n");
@@ -81,9 +85,11 @@ void usage ()
exit (1);
}
-char *chantype (int type)
+static const char *
+chantype(int type)
{
switch (type) {
+ default:
case T_NONE: return ("none");
case T_ASYNC: return ("RS-232");
case T_UNIV_RS232: return ("RS-232");
@@ -95,7 +101,8 @@ char *chantype (int type)
}
}
-char *chanmode (int mode)
+static const char *
+chanmode(int mode)
{
switch (mode) {
case M_ASYNC: return ("Async");
@@ -106,7 +113,8 @@ char *chanmode (int mode)
}
}
-void getchan (int channel)
+static void
+getchan(int channel)
{
int s = open (CXDEV, 0);
if (s < 0)
@@ -121,7 +129,8 @@ void getchan (int channel)
o.channel);
}
-int printstats (int channel, int hflag)
+static int
+printstats(int channel, int hflag)
{
int s, res;
@@ -143,7 +152,8 @@ int printstats (int channel, int hflag)
return (0);
}
-void printallstats ()
+static void
+printallstats(void)
{
int b, c;
@@ -153,7 +163,8 @@ void printallstats ()
printstats (b*NCHAN + c, 0);
}
-void setchan (int channel)
+static void
+setchan(int channel)
{
int s = open (CXDEV, 0);
if (s < 0)
@@ -165,7 +176,8 @@ void setchan (int channel)
close (s);
}
-void printopt ()
+static void
+printopt(void)
{
/* Common channel options */
/* channel option register 4 */
@@ -376,13 +388,14 @@ void printopt ()
}
}
-void printchan (int channel)
+static void
+printchan(int channel)
{
printf ("cx%d (%s) %s", channel, chantype (o.type), chanmode (o.mode));
if (o.txbaud == o.rxbaud)
- printf (" %d", o.rxbaud);
+ printf (" %lu", o.rxbaud);
else
- printf (" ospeed=%d ispeed=%d", o.txbaud, o.rxbaud);
+ printf (" ospeed=%lu ispeed=%lu", o.txbaud, o.rxbaud);
if ((o.channel == 0 || o.channel == 8) &&
(o.type == T_UNIV_V35 || o.type == T_UNIV_RS449))
printf (" port=%s", o.iftype ? (o.type == T_UNIV_V35 ?
@@ -397,7 +410,8 @@ void printchan (int channel)
printopt ();
}
-void printall ()
+static void
+printall(void)
{
struct ifconf ifc;
struct ifreq *ifr;
@@ -435,7 +449,8 @@ void printall ()
close (s);
}
-void set_interface_type (char *type)
+static void
+set_interface_type(char *type)
{
if (o.channel != 0 && o.channel != 8) {
printf ("interface option is applicable only for channels 0 and 8\n");
@@ -451,7 +466,8 @@ void set_interface_type (char *type)
o.iftype = 1;
}
-void set_master (char *ifname)
+static void
+set_master(char *ifname)
{
if (o.type == T_ASYNC) {
printf ("master option is not applicable for async channels\n");
@@ -460,7 +476,8 @@ void set_master (char *ifname)
strcpy (o.master, ifname);
}
-void set_async_opt (char *opt)
+static void
+set_async_opt(char *opt)
{
/* channel option register 1 */
if (! strncasecmp (opt, "cs", 2)) o.aopt.cor1.charlen = atoi (opt + 2) - 1;
@@ -539,7 +556,8 @@ void set_async_opt (char *opt)
usage ();
}
-void set_hdlc_opt (char *opt)
+static void
+set_hdlc_opt(char *opt)
{
/* hdlc channel option register 1 */
if (! strncasecmp (opt, "if", 2)) o.hopt.cor1.ifflags = atoi (opt + 2);
@@ -585,17 +603,20 @@ void set_hdlc_opt (char *opt)
else usage ();
}
-void set_bisync_opt (char *opt)
+static void
+set_bisync_opt(char *opt __unused)
{
usage ();
}
-void set_x21_opt (char *opt)
+static void
+set_x21_opt(char *opt __unused)
{
usage ();
}
-int main (int argc, char **argv)
+int
+main(int argc, char **argv)
{
int channel;
OpenPOWER on IntegriCloud