Mark local functions as static. Also remove some double newlines between
function definitions.


Index: sbin/pfctl/pfctl_osfp.c
===================================================================
RCS file: /cvs/src/sbin/pfctl/pfctl_osfp.c,v
retrieving revision 1.23
diff -u -p -r1.23 pfctl_osfp.c
--- sbin/pfctl/pfctl_osfp.c     10 Dec 2015 17:27:00 -0000      1.23
+++ sbin/pfctl/pfctl_osfp.c     27 May 2017 17:35:04 -0000
@@ -62,22 +62,22 @@ struct name_list classes = LIST_HEAD_INI
 int class_count;
 int fingerprint_count;
 
-void                    add_fingerprint(int, int, struct pf_osfp_ioctl *);
-struct name_entry      *fingerprint_name_entry(struct name_list *, char *);
-void                    pfctl_flush_my_fingerprints(struct name_list *);
-char                   *get_field(char **, size_t *, int *);
-int                     get_int(char **, size_t *, int *, int *, const char *,
+static void             add_fingerprint(int, int, struct pf_osfp_ioctl *);
+static struct name_entry *fingerprint_name_entry(struct name_list *, char *);
+static void             pfctl_flush_my_fingerprints(struct name_list *);
+static char            *get_field(char **, size_t *, int *);
+static int              get_int(char **, size_t *, int *, int *, const char *,
                             int, int, const char *, int);
-int                     get_str(char **, size_t *, char **, const char *, int,
+static int              get_str(char **, size_t *, char **, const char *, int,
                             const char *, int);
-int                     get_tcpopts(const char *, int, const char *,
+static int              get_tcpopts(const char *, int, const char *,
                            pf_tcpopts_t *, int *, int *, int *, int *, int *,
                            int *);
-void                    import_fingerprint(struct pf_osfp_ioctl *);
-const char             *print_ioctl(struct pf_osfp_ioctl *);
-void                    print_name_list(int, struct name_list *, const char *);
-void                    sort_name_list(int, struct name_list *);
-struct name_entry      *lookup_name_list(struct name_list *, const char *);
+static void             import_fingerprint(struct pf_osfp_ioctl *);
+static const char      *print_ioctl(struct pf_osfp_ioctl *);
+static void             print_name_list(int, struct name_list *, const char *);
+static void             sort_name_list(int, struct name_list *);
+static struct name_entry *lookup_name_list(struct name_list *, const char *);
 
 /* Load fingerprints from a file */
 int
@@ -262,7 +262,7 @@ pfctl_clear_fingerprints(int dev, int op
 }
 
 /* flush pfctl's view of the fingerprints */
-void
+static void
 pfctl_flush_my_fingerprints(struct name_list *list)
 {
        struct name_entry *nm;
@@ -516,7 +516,7 @@ found:
 }
 
 /* lookup a name in a list */
-struct name_entry *
+static struct name_entry *
 lookup_name_list(struct name_list *list, const char *name)
 {
        struct name_entry *nm;
@@ -527,8 +527,7 @@ lookup_name_list(struct name_list *list,
        return (NULL);
 }
 
-
-void
+static void
 add_fingerprint(int dev, int opts, struct pf_osfp_ioctl *fp)
 {
        struct pf_osfp_ioctl fptmp;
@@ -639,7 +638,7 @@ add_fingerprint(int dev, int opts, struc
 }
 
 /* import a fingerprint from the kernel */
-void
+static void
 import_fingerprint(struct pf_osfp_ioctl *fp)
 {
        struct name_entry *nm_class, *nm_version, *nm_subtype;
@@ -678,7 +677,7 @@ import_fingerprint(struct pf_osfp_ioctl 
 }
 
 /* Find an entry for a fingerprints class/version/subtype */
-struct name_entry *
+static struct name_entry *
 fingerprint_name_entry(struct name_list *list, char *name)
 {
        struct name_entry *nm_entry;
@@ -704,8 +703,7 @@ fingerprint_name_entry(struct name_list 
        return (nm_entry);
 }
 
-
-void
+static void
 print_name_list(int opts, struct name_list *nml, const char *prefix)
 {
        char newprefix[32];
@@ -719,7 +717,7 @@ print_name_list(int opts, struct name_li
        }
 }
 
-void
+static void
 sort_name_list(int opts, struct name_list *nml)
 {
        struct name_list new;
@@ -760,7 +758,7 @@ sort_name_list(int opts, struct name_lis
 }
 
 /* parse the next integer in a formatted config file line */
-int
+static int
 get_int(char **line, size_t *len, int *var, int *mod,
     const char *name, int flags, int max, const char *filename, int lineno)
 {
@@ -849,7 +847,7 @@ get_int(char **line, size_t *len, int *v
 }
 
 /* parse the next string in a formatted config file line */
-int
+static int
 get_str(char **line, size_t *len, char **v, const char *name, int minlen,
     const char *filename, int lineno)
 {
@@ -874,7 +872,7 @@ get_str(char **line, size_t *len, char *
 }
 
 /* Parse out the TCP opts */
-int
+static int
 get_tcpopts(const char *filename, int lineno, const char *tcpopts,
     pf_tcpopts_t *packed, int *optcnt, int *mss, int *mss_mod, int *wscale,
     int *wscale_mod, int *ts0)
@@ -962,7 +960,7 @@ get_tcpopts(const char *filename, int li
 }
 
 /* rip the next field out of a formatted config file line */
-char *
+static char *
 get_field(char **line, size_t *len, int *fieldlen)
 {
        char *ret, *ptr = *line;
@@ -989,8 +987,7 @@ get_field(char **line, size_t *len, int 
        return (ret);
 }
 
-
-const char *
+static const char *
 print_ioctl(struct pf_osfp_ioctl *fp)
 {
        static char buf[1024];


-- 
Michal Mazurek

Reply via email to