Silence warnings (most about constness) and clamp down with WARNS=2.

Tested on i386 and alpha.
This commit is contained in:
dd 2001-05-28 06:14:48 +00:00
parent b858bb6c1b
commit 401f308d6e
2 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,7 @@
# $FreeBSD$
PROG= id
WARNS?= 2
MAN= id.1 groups.1 whoami.1
# XXX BROKEN: afterinstall:

View File

@ -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;