summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifmedia.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-06-23 23:49:52 +0000
committerdelphij <delphij@FreeBSD.org>2009-06-23 23:49:52 +0000
commite55dc5c4eb8e9b93da21c537889150f3b177e253 (patch)
tree49d38a468ae2e816db3ae5582c13e8b2d759fc28 /sbin/ifconfig/ifmedia.c
parent6890bf4027e4cc291de70a201516b9ba03dc3cf7 (diff)
downloadFreeBSD-src-e55dc5c4eb8e9b93da21c537889150f3b177e253.zip
FreeBSD-src-e55dc5c4eb8e9b93da21c537889150f3b177e253.tar.gz
- Use size_t instead of int when appropriate;
- Use C99 sparse initialization. With these changes ifconfig(8) is WARNS=2 clean.
Diffstat (limited to 'sbin/ifconfig/ifmedia.c')
-rw-r--r--sbin/ifconfig/ifmedia.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c
index 04e2222..d89f3eb 100644
--- a/sbin/ifconfig/ifmedia.c
+++ b/sbin/ifconfig/ifmedia.c
@@ -330,7 +330,7 @@ setmediainst(const char *val, int d, int s, const struct afswtch *afp)
ifmr = ifmedia_getstate(s);
inst = atoi(val);
- if (inst < 0 || inst > IFM_INST_MAX)
+ if (inst < 0 || inst > (int)IFM_INST_MAX)
errx(1, "invalid media instance: %s", val);
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
@@ -822,7 +822,7 @@ static __constructor void
ifmedia_ctor(void)
{
#define N(a) (sizeof(a) / sizeof(a[0]))
- int i;
+ size_t i;
for (i = 0; i < N(media_cmds); i++)
cmd_register(&media_cmds[i]);
OpenPOWER on IntegriCloud