From fcf9752bb7cfa0955234368e43600610c4308242 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 2 Sep 2016 16:44:34 +0000 Subject: Make functions and variables static whenever possible. style(9) says: "Function prototypes for private functions (i.e., functions not used elsewhere) go at the top of the first source module. In userland, functions local to one source module should be declared 'static'". The benefits of doing so include: * clean up of the eigrpd global namespace; * improved readability; * more hints to the compiler/linker to generate more efficient code. Additional changes: * Declare all extern variables in header files; * Clean up the indentation of all function prototypes and global variables. ok claudio@ benno@ --- usr.sbin/eigrpd/log.h | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'usr.sbin/eigrpd/log.h') diff --git a/usr.sbin/eigrpd/log.h b/usr.sbin/eigrpd/log.h index cfd1eac4a19..557a4d47ee4 100644 --- a/usr.sbin/eigrpd/log.h +++ b/usr.sbin/eigrpd/log.h @@ -1,4 +1,4 @@ -/* $OpenBSD: log.h,v 1.3 2016/07/18 21:14:30 benno Exp $ */ +/* $OpenBSD: log.h,v 1.4 2016/09/02 16:44:33 renato Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -21,25 +21,24 @@ #include -void log_init(int); -void log_verbose(int); -void logit(int, const char *, ...) - __attribute__((__format__ (printf, 2, 3))); -void vlog(int, const char *, va_list) - __attribute__((__format__ (printf, 2, 0))); -void log_warn(const char *, ...) - __attribute__((__format__ (printf, 1, 2))); -void log_warnx(const char *, ...) - __attribute__((__format__ (printf, 1, 2))); -void log_info(const char *, ...) - __attribute__((__format__ (printf, 1, 2))); -void log_debug(const char *, ...) - __attribute__((__format__ (printf, 1, 2))); -void fatal(const char *) __dead - __attribute__((__format__ (printf, 1, 0))); -void fatalx(const char *) __dead - __attribute__((__format__ (printf, 1, 0))); - +void log_init(int); +void log_verbose(int); +void logit(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +void vlog(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +void log_warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_info(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_debug(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void fatal(const char *) __dead + __attribute__((__format__ (printf, 1, 0))); +void fatalx(const char *) __dead + __attribute__((__format__ (printf, 1, 0))); const char *log_in6addr(const struct in6_addr *); const char *log_in6addr_scope(const struct in6_addr *, unsigned int); const char *log_sockaddr(void *); -- cgit v1.2.3