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/interface.c | |
parent | 45716f877b940ffa38efc82d1692cbcc216caba2 (diff) |
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 'src/interface.c')
-rw-r--r-- | src/interface.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/interface.c b/src/interface.c index 4c2190783..31f8666e0 100644 --- a/src/interface.c +++ b/src/interface.c @@ -56,7 +56,7 @@ #define INTERFACE_MAX_OUTPUT_BUFFER_SIZE_DEFAULT (8192*1024) /* set this to zero to indicate we have no possible interfaces */ -static int interface_max_connections = 0; /*INTERFACE_MAX_CONNECTIONS_DEFAULT; */ +static int interface_max_connections; /*INTERFACE_MAX_CONNECTIONS_DEFAULT; */ static int interface_timeout = INTERFACE_TIMEOUT_DEFAULT; static size_t interface_max_command_list_size = INTERFACE_MAX_COMMAND_LIST_DEFAULT; @@ -70,9 +70,9 @@ static struct ioOps *ioList; static long int interface_list_cache_size = 32; /* shared globally between all interfaces: */ -static struct strnode *list_cache = NULL; -static struct strnode *list_cache_head = NULL; -static struct strnode *list_cache_tail = NULL; +static struct strnode *list_cache; +static struct strnode *list_cache_head; +static struct strnode *list_cache_tail; typedef struct _Interface { char buffer[INTERFACE_MAX_BUFFER_LENGTH]; @@ -98,7 +98,7 @@ typedef struct _Interface { int send_buf_alloc; /* bytes actually allocated */ } Interface; -static Interface *interfaces = NULL; +static Interface *interfaces; static void flushInterfaceBuffer(Interface * interface); @@ -731,7 +731,7 @@ static void flushInterfaceBuffer(Interface * interface) int interfacePrintWithFD(int fd, char *buffer, int buflen) { - static int i = 0; + static int i; int copylen; Interface *interface; |