diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-02-10 13:34:21 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-02-10 13:34:21 +0000 |
commit | 2f301637c8b662c3aa9e698db39095d0a62729de (patch) | |
tree | 97c65bdf57483909a1d76204754e13fa554a6d5c /usr.bin/top | |
parent | d0f687d30f4c194d22fd238ee72aebe19d0f7be9 (diff) | |
download | src-2f301637c8b662c3aa9e698db39095d0a62729de.tar.gz src-2f301637c8b662c3aa9e698db39095d0a62729de.zip |
Fix multiple warnings in usr.bin/top about variables shadowing global
declarations from base gcc, by renaming those variables.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=343958
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/top/username.c | 6 | ||||
-rw-r--r-- | usr.bin/top/utils.c | 6 |
3 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile index 148fd96c1914..d11b91273b50 100644 --- a/usr.bin/top/Makefile +++ b/usr.bin/top/Makefile @@ -7,9 +7,5 @@ SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c MAN= top.1 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -NO_WERROR= -.endif - LIBADD= ncursesw m kvm jail util sbuf .include <bsd.prog.mk> diff --git a/usr.bin/top/username.c b/usr.bin/top/username.c index 3b15b6a2231e..be2efa8f2135 100644 --- a/usr.bin/top/username.c +++ b/usr.bin/top/username.c @@ -70,7 +70,7 @@ username(int uid) } int -userid(char username[]) +userid(char username_[]) { struct passwd *pwd; @@ -78,13 +78,13 @@ userid(char username[]) but for now we just do it simply and remember just the result. */ - if ((pwd = getpwnam(username)) == NULL) + if ((pwd = getpwnam(username_)) == NULL) { return(-1); } /* enter the result in the hash table */ - enter_user(pwd->pw_uid, username, 1); + enter_user(pwd->pw_uid, username_, 1); /* return our result */ return(pwd->pw_uid); diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c index 1ac0d6ad1516..b3d4b15be28b 100644 --- a/usr.bin/top/utils.c +++ b/usr.bin/top/utils.c @@ -292,11 +292,11 @@ char * format_k(int64_t amt) { static char retarray[NUM_STRINGS][16]; - static int index = 0; + static int index_ = 0; char *ret; - ret = retarray[index]; - index = (index + 1) % NUM_STRINGS; + ret = retarray[index_]; + index_ = (index_ + 1) % NUM_STRINGS; humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); return (ret); } |