diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-01-14 03:07:53 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-01-14 03:07:53 +0000 |
commit | b443363aa6081749883a92f9955a95c4301df00a (patch) | |
tree | 7fa3aa1c9779167d9c8daa7fda640ecab64fd25c /src/log.c | |
parent | 45716f877b940ffa38efc82d1692cbcc216caba2 (diff) | |
download | mpd-b443363aa6081749883a92f9955a95c4301df00a.tar.gz mpd-b443363aa6081749883a92f9955a95c4301df00a.tar.xz mpd-b443363aa6081749883a92f9955a95c4301df00a.zip |
Don't initialize globals to zero (or NULL)
Some compilers and linkers aren't smart enough to optimize this,
as global variables are implictly initialized to zero. As a
result, binaries are a bit smaller as more goes in the .bss and
less in the text section.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/log.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -30,13 +30,13 @@ #include <time.h> static unsigned int logLevel = LOG_LEVEL_LOW; -static int warningFlushed = 0; +static int warningFlushed; static int stdout_mode = 1; -static char *warningBuffer = NULL; +static char *warningBuffer; static int out_fd = -1; static int err_fd = -1; -static const char *out_filename = NULL; -static const char *err_filename = NULL; +static const char *out_filename; +static const char *err_filename; /* redirect stdin to /dev/null to work around a libao bug */ static void redirect_stdin(void) @@ -60,7 +60,7 @@ static void redirect_logs(void) static const char *log_date(void) { - static char buf[16] = { '\0' }; + static char buf[16]; time_t t = time(NULL); strftime(buf, 16, "%b %d %H:%M : ", localtime(&t)); return buf; |