summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-05-28 06:14:48 +0000
committerdd <dd@FreeBSD.org>2001-05-28 06:14:48 +0000
commitec2af058ec624823b0fb46949837acc36211be60 (patch)
tree2a58a10cccc175f5483e49aaacf8d4471cb9e9d1 /usr.bin
parent9e9f71093e56ae94ce7bf39dcb7108e907676a77 (diff)
downloadFreeBSD-src-ec2af058ec624823b0fb46949837acc36211be60.zip
FreeBSD-src-ec2af058ec624823b0fb46949837acc36211be60.tar.gz
Silence warnings (most about constness) and clamp down with WARNS=2.
Tested on i386 and alpha.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/id/Makefile1
-rw-r--r--usr.bin/id/id.c11
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/id/Makefile b/usr.bin/id/Makefile
index 104d75d..8ecd6e9 100644
--- a/usr.bin/id/Makefile
+++ b/usr.bin/id/Makefile
@@ -2,6 +2,7 @@
# $FreeBSD$
PROG= id
+WARNS?= 2
MAN= id.1 groups.1 whoami.1
# XXX BROKEN: afterinstall:
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index 4c1150a..a18dc4a 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -55,6 +55,7 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
+int main __P((int, char *[]));
void current __P((void));
void pline __P((struct passwd *));
void pretty __P((struct passwd *));
@@ -205,7 +206,7 @@ current()
struct passwd *pw;
int cnt, id, eid, lastid, ngroups;
gid_t groups[NGROUPS];
- char *fmt;
+ const char *fmt;
id = getuid();
(void)printf("uid=%u", id);
@@ -241,10 +242,10 @@ current()
void
user(pw)
- register struct passwd *pw;
+ struct passwd *pw;
{
- register struct group *gr;
- register char *fmt;
+ struct group *gr;
+ const char *fmt;
int cnt, gid, lastgid, ngroups, groups[NGROUPS + 1];
(void)printf("uid=%u(%s)", pw->pw_uid, pw->pw_name);
@@ -275,7 +276,7 @@ group(pw, nflag)
struct group *gr;
int cnt, id, lastid, ngroups;
gid_t groups[NGROUPS + 1];
- char *fmt;
+ const char *fmt;
if (pw) {
ngroups = NGROUPS + 1;
OpenPOWER on IntegriCloud