From 51a3a6279cdc272c425ef067f2fea0f6f823fc1f Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sat, 25 Mar 2006 11:15:53 +0000 Subject: [PATCH] -Wall cleanups --- src/conf.c | 1 + src/configfile.c | 2 +- src/db-generic.c | 7 ++++++- src/dispatch.c | 2 +- src/redblack.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/conf.c b/src/conf.c index 7329ad2e..587f8961 100644 --- a/src/conf.c +++ b/src/conf.c @@ -640,6 +640,7 @@ char *conf_alloc_string (char *section, char *key, char *dflt) { int size = -1; char *out; + /* FIXME: races */ conf_get_string(section, key, dflt, NULL, &size); out = (char *)malloc(size * sizeof(char)); diff --git a/src/configfile.c b/src/configfile.c index 5c6198d6..015a37f2 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -320,7 +320,7 @@ void config_handler(WS_CONNINFO *pwsc) { char web_root[PATH_MAX]; int file_fd; struct stat sb; - char *pw, *web_root; + char *pw; int size; size = sizeof(web_root); diff --git a/src/db-generic.c b/src/db-generic.c index 0db8ba3f..da186529 100644 --- a/src/db-generic.c +++ b/src/db-generic.c @@ -29,7 +29,12 @@ #include #include #include -#include +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif #include "db-generic.h" #include "err.h" diff --git a/src/dispatch.c b/src/dispatch.c index fb2e90c8..3b9231b8 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -192,7 +192,7 @@ void daap_handler(WS_CONNINFO *pwsc) { */ pqi->index_type=indexTypeNone; - + l = h = 0; index=ws_getvar(pwsc,"index"); if(index) { DPRINTF(E_DBG,L_DAAP,"Indexed query: %s\n",index); diff --git a/src/redblack.c b/src/redblack.c index a6be6a60..d0392da3 100644 --- a/src/redblack.c +++ b/src/redblack.c @@ -451,7 +451,7 @@ static struct RB_ENTRY(node) * RB_ENTRY(_lookup)(int mode, const RB_ENTRY(data_t) *key, struct RB_ENTRY(tree) *rbinfo) { struct RB_ENTRY(node) *x,*y; - int cmp; + int cmp=0;; int found=0; y=RBNULL; /* points to the parent of x */