Move some bytes from data to text, make use of the ARRAY_SIZE macro
authorVolker Lendecke <vl@samba.org>
Sun, 14 Dec 2008 12:18:22 +0000 (13:18 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 19 Dec 2008 12:38:54 +0000 (13:38 +0100)
Probably pointless, but it doesn't add complexity and it is fun to see bss and
data shrink :-)

source3/lib/debug.c

index 193e9efc965d5aeb3a72cf9d8b819042d9e6d29e..14aca3adad2fd63d79bb4a7a4eee038d05b3eb0d 100644 (file)
@@ -832,7 +832,7 @@ void check_log_size( void )
                /* map debug levels to syslog() priorities
                 * note that not all DEBUG(0, ...) calls are
                 * necessarily errors */
-               static int priority_map[] = {
+               static const int priority_map[4] = {
                        LOG_ERR,     /* 0 */
                        LOG_WARNING, /* 1 */
                        LOG_NOTICE,  /* 2 */
@@ -842,7 +842,7 @@ void check_log_size( void )
                char *msgbuf = NULL;
                int ret;
 
-               if( syslog_level >= ( sizeof(priority_map) / sizeof(priority_map[0]) ) || syslog_level < 0)
+               if( syslog_level >= ARRAY_SIZE(priority_map) || syslog_level < 0)
                        priority = LOG_DEBUG;
                else
                        priority = priority_map[syslog_level];