summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-08-27 08:05:55 +0000
committerEric Wong <normalperson@yhbt.net>2007-08-27 08:05:55 +0000
commit0f2e9ee6623ab30c190dfc5c575922af1990c9d9 (patch)
treef873b0f2cd267482ffda8e63fc9bc44a07068fc8 /src
parent75e34a19a3094b975da38fcfaea5d519a60b34a1 (diff)
export FATAL() with noreturn attribute
This attribute was set in log.c, but not exported to other modules in log.h This allows us to remove some unneccessary variable initializations that were added in r6277. I did audioOutput_shout.c a bit differently, to avoid some jumps. before: $ size src/mpd text data bss dec hex filename 225546 4040 14600 244186 3b9da src/mpd after: $ size src/mpd text data bss dec hex filename 224698 4040 14600 243338 3b68a src/mpd git-svn-id: https://svn.musicpd.org/mpd/trunk@6821 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/audioOutputs/audioOutput_shout.c4
-rw-r--r--src/listen.c6
-rw-r--r--src/log.h2
-rw-r--r--src/state_file.c1
4 files changed, 5 insertions, 8 deletions
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index 294d6a152..a58ece755 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -158,9 +158,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
if (blockParam) {
if (0 == strcmp(blockParam->value, "yes")) {
public = 1;
- } else if (0 == strcmp(blockParam->value, "no")) {
- public = 0;
- } else {
+ } else if (strcmp(blockParam->value, "no")) {
FATAL("public \"%s\" is not \"yes\" or \"no\" at line "
"%i\n", param->value, param->line);
}
diff --git a/src/listen.c b/src/listen.c
index 9d105e815..8b89ee33a 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -53,7 +53,7 @@ int boundPort;
static int establishListen(unsigned int port,
struct sockaddr *addrp, socklen_t addrlen)
{
- int pf = 0;
+ int pf;
int sock;
int allowReuse = ALLOW_REUSE;
@@ -105,8 +105,8 @@ static int establishListen(unsigned int port,
static void parseListenConfigParam(unsigned int port, ConfigParam * param)
{
- struct sockaddr *addrp = NULL;
- socklen_t addrlen = 0;
+ struct sockaddr *addrp;
+ socklen_t addrlen;
struct sockaddr_in sin;
#ifdef HAVE_IPV6
struct sockaddr_in6 sin6;
diff --git a/src/log.h b/src/log.h
index 34f6ac00e..3ba7afe86 100644
--- a/src/log.h
+++ b/src/log.h
@@ -33,7 +33,7 @@ mpd_printf void LOG(const char *fmt, ...);
mpd_printf void SECURE(const char *fmt, ...);
mpd_printf void DEBUG(const char *fmt, ...);
mpd_printf void WARNING(const char *fmt, ...);
-mpd_printf void FATAL(const char *fmt, ...);
+mpd_printf mpd_noreturn void FATAL(const char *fmt, ...);
void initLog(const int verbose);
diff --git a/src/state_file.c b/src/state_file.c
index ac2fcde7a..1b0b41f1a 100644
--- a/src/state_file.c
+++ b/src/state_file.c
@@ -106,6 +106,5 @@ void read_state_file(void)
void mpd_noreturn state_file_fatal(void)
{
FATAL("error parsing state file \"%s\"\n", sfpath);
- exit(EXIT_FAILURE);
}