Hi,
Flag functions as static and __dead when appropriate. Allows apm to be
compiled using `clang -Wall`. While here, sort and align function
declarations.

Comments? OK?

Index: apm.c
===================================================================
RCS file: /cvs/src/usr.sbin/apm/apm.c,v
retrieving revision 1.32
diff -u -p -r1.32 apm.c
--- apm.c       1 Nov 2015 14:13:30 -0000       1.32
+++ apm.c       23 Jul 2017 09:55:25 -0000
@@ -50,13 +50,13 @@
 
 extern char *__progname;
 
-void usage(void);
-void zzusage(void);
-int do_zzz(int, enum apm_action action);
-int open_socket(const char *pn);
-int send_command(int fd, struct apm_command *cmd, struct apm_reply *reply);
+static int             do_zzz(int, enum apm_action action);
+static int             open_socket(const char *pn);
+static int             send_command(int fd, struct apm_command *cmd, struct 
apm_reply *reply);
+static __dead void     usage(void);
+static __dead void     zzusage(void);
 
-void
+static __dead void
 usage(void)
 {
        fprintf(stderr,"usage: %s [-AabHLlmPSvZz] [-f sockname]\n",
@@ -64,7 +64,7 @@ usage(void)
        exit(1);
 }
 
-void
+static __dead void
 zzusage(void)
 {
        fprintf(stderr,"usage: %s [-SZz] [-f sockname]\n",
@@ -72,7 +72,7 @@ zzusage(void)
        exit(1);
 }
 
-int
+static int
 send_command(int fd, struct apm_command *cmd, struct apm_reply *reply)
 {
        /* send a command to the apm daemon */
@@ -90,7 +90,7 @@ send_command(int fd, struct apm_command 
        return (0);
 }
 
-int
+static int
 do_zzz(int fd, enum apm_action action)
 {
        struct apm_command command;
@@ -119,7 +119,7 @@ do_zzz(int fd, enum apm_action action)
        exit(send_command(fd, &command, &reply));
 }
 
-int
+static int
 open_socket(const char *sockname)
 {
        int sock, errr;

Reply via email to