From 88b70560464afbc44c6233abbb7375fd5c464124 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 12 Nov 1992 04:14:54 +0000 Subject: all files: make most variables static and const when possible. declare lots of functions static. --- src/id.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/id.c') diff --git a/src/id.c b/src/id.c index 1c9482fc6..e7aa8835d 100644 --- a/src/id.c +++ b/src/id.c @@ -58,11 +58,12 @@ gid_t getegid (); char *xmalloc (); int getugroups (); void error (); -void print_user (); -void print_group (); -void print_group_list (); -void print_full_info (); -void usage (); + +static void print_user (); +static void print_group (); +static void print_group_list (); +static void print_full_info (); +static void usage (); /* The name this program was run with. */ char *program_name; @@ -89,7 +90,7 @@ static gid_t rgid, egid; /* The number of errors encountered so far. */ static int problems = 0; -static struct option longopts[] = +static struct option const longopts[] = { {"group", 0, NULL, 'g'}, {"name", 0, NULL, 'n'}, @@ -173,7 +174,7 @@ main (argc, argv) /* Print the name or value of user ID UID. */ -void +static void print_user (uid) int uid; { @@ -194,7 +195,7 @@ print_user (uid) /* Print the name or value of group ID GID. */ -void +static void print_group (gid) int gid; { @@ -215,7 +216,7 @@ print_group (gid) /* Print all of the distinct groups the user is in . */ -void +static void print_group_list (username) char *username; { @@ -258,7 +259,7 @@ print_group_list (username) /* Print all of the info about the user's user and group IDs. */ -void +static void print_full_info (username) char *username; { @@ -336,7 +337,7 @@ print_full_info (username) #endif } -void +static void usage () { fprintf (stderr, "\ -- cgit v1.2.3-54-g00ecf