aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/syslog.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2013-04-09 16:16:34 +0000
committerEd Schouten <ed@FreeBSD.org>2013-04-09 16:16:34 +0000
commit7c99b6764e47f50ceefaf02482e589a76216b05d (patch)
tree984c9ec0b986d4b7ad1f72e3a3107d82c5a5281c /sys/sys/syslog.h
parent8cf455b8d98631b1783769a96e9f5ad2551777a5 (diff)
downloadsrc-7c99b6764e47f50ceefaf02482e589a76216b05d.tar.gz
src-7c99b6764e47f50ceefaf02482e589a76216b05d.zip
Add static/const keywords to the arrays.
This theoretically allows a compiler to optimize (parts of) the array away if unused. While there, make the array size implicit and use a _Static_assert() to ensure that the definition matches up with the number of elements in the list.
Notes
Notes: svn path=/head/; revision=249311
Diffstat (limited to 'sys/sys/syslog.h')
-rw-r--r--sys/sys/syslog.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h
index 6f12831434bd..61bad21ccb2f 100644
--- a/sys/sys/syslog.h
+++ b/sys/sys/syslog.h
@@ -69,7 +69,7 @@ typedef struct _code {
int c_val;
} CODE;
-CODE prioritynames[] = {
+static const CODE prioritynames[] = {
{ "alert", LOG_ALERT, },
{ "crit", LOG_CRIT, },
{ "debug", LOG_DEBUG, },
@@ -122,7 +122,7 @@ CODE prioritynames[] = {
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
#ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
+static const CODE facilitynames[] = {
{ "auth", LOG_AUTH, },
{ "authpriv", LOG_AUTHPRIV, },
{ "console", LOG_CONSOLE, },