Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2020 18:25:12 GMT
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ff7c2c5a3bc3 - main - [wlanstats] Fix warnings-as-errors on gcc-6.4 on mips
Message-ID:  <202012291825.0BTIPC2n055848@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=ff7c2c5a3bc3321ea7eeab824eff25257e7fbaae

commit ff7c2c5a3bc3321ea7eeab824eff25257e7fbaae
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2020-12-29 01:03:11 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2020-12-29 18:24:30 +0000

    [wlanstats] Fix warnings-as-errors on gcc-6.4 on mips
    
    * use CLLADDR() to not try deconsting a const
    * Unsigned where they should be
    * static where it should be
    
    Tested:
    
    * freebsd/mips32, using gcc-6.4
---
 tools/tools/net80211/wlanstats/main.c      |  8 +++++---
 tools/tools/net80211/wlanstats/wlanstats.c | 10 +++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/tools/tools/net80211/wlanstats/main.c b/tools/tools/net80211/wlanstats/main.c
index bd73053be976..36da5c6b8e51 100644
--- a/tools/tools/net80211/wlanstats/main.c
+++ b/tools/tools/net80211/wlanstats/main.c
@@ -70,7 +70,7 @@ static struct {
 static const char *
 getfmt(const char *tag)
 {
-	int i;
+	unsigned int i;
 	for (i = 0; i < nitems(tags); i++)
 		if (strcasecmp(tags[i].tag, tag) == 0)
 			return tags[i].fmt;
@@ -156,8 +156,10 @@ print_sta_stats(FILE *fd, const u_int8_t macaddr[IEEE80211_ADDR_LEN])
 }
 #endif
 
-void
-usage(void) {
+static void
+usage(void)
+{
+
 	printf("wlanstats: [-ah] [-i ifname] [-l] [-m station MAC address] [-o fmt] [interval]\n");
 }
 
diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/tools/tools/net80211/wlanstats/wlanstats.c
index b42d7312e519..2f362a60a836 100644
--- a/tools/tools/net80211/wlanstats/wlanstats.c
+++ b/tools/tools/net80211/wlanstats/wlanstats.c
@@ -463,7 +463,7 @@ getlladdr(struct wlanstatfoo_p *wf)
 		errx(1, "did not find link layer address for interface %s",
 			wf->ifr.ifr_name);
 	sdl = (const struct sockaddr_dl *) p->ifa_addr;
-	IEEE80211_ADDR_COPY(wf->mac, LLADDR(sdl));
+	IEEE80211_ADDR_COPY(wf->mac, CLLADDR(sdl));
 	freeifaddrs(ifp);
 }
 
@@ -561,8 +561,8 @@ wlan_update_tot(struct bsdstat *sf)
 	wf->ntotal = wf->ncur;
 }
 
-void
-setreason(char b[], size_t bs, int v)
+static void
+setreason(char b[], size_t bs, unsigned int v)
 {
     static const char *reasons[] = {
 	[IEEE80211_REASON_UNSPECIFIED]		= "unspecified",
@@ -595,8 +595,8 @@ setreason(char b[], size_t bs, int v)
 	    snprintf(b, bs, "%u", v);
 }
 
-void
-setstatus(char b[], size_t bs, int v)
+static void
+setstatus(char b[], size_t bs, unsigned int v)
 {
     static const char *status[] = {
 	[IEEE80211_STATUS_SUCCESS]		= "success",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012291825.0BTIPC2n055848>