From 0a066775fe988ab36bd72583cf34d14784039fe3 Mon Sep 17 00:00:00 2001 Message-Id: <0a066775fe988ab36bd72583cf34d14784039fe3.1714662050.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 1 Dec 2012 11:20:14 +0000 Subject: [PATCH] build: various fixes for ubuntu 12.10/gcc 4.7 Organization: Straylight/Edgeware From: Richard Kettlewell - One_old_user() is obsolete and uses nonexistent functions; I guess earlier GCC removed it before checking for errors. - Remove or use various unused objects that GCC is now better at spotting. - Makefile -l ordering fixes. --- lib/trackdb.c | 34 ---------------------------------- lib/xgetdate.c | 2 -- libtests/Makefile.am | 4 ++-- libtests/t-eventdist.c | 3 +++ server/play.c | 2 -- 5 files changed, 5 insertions(+), 40 deletions(-) diff --git a/lib/trackdb.c b/lib/trackdb.c index aa9ad56..7fbdeb5 100644 --- a/lib/trackdb.c +++ b/lib/trackdb.c @@ -3047,40 +3047,6 @@ static int create_user(const char *user, return trackdb_putdata(trackdb_usersdb, user, k, tid, flags); } -/** @brief Add one pre-existing user - * @param user Username - * @param password password - * @param tid Owning transaction - * @return 0, DB_KEYEXIST or DB_LOCK_DEADLOCK - * - * Used only in upgrade from old versions. - */ -static int one_old_user(const char *user, const char *password, - DB_TXN *tid) { - const char *rights; - - /* www-data doesn't get added */ - if(!strcmp(user, "www-data")) { - disorder_info("not adding www-data to user database"); - return 0; - } - /* pick rights */ - if(!strcmp(user, "root")) - rights = "all"; - else if(trusted(user)) { - rights_type r; - - parse_rights(config->default_rights, &r, 1); - r &= ~(rights_type)(RIGHT_SCRATCH__MASK|RIGHT_MOVE__MASK|RIGHT_REMOVE__MASK); - r |= (RIGHT_ADMIN|RIGHT_RESCAN - |RIGHT_SCRATCH_ANY|RIGHT_MOVE_ANY|RIGHT_REMOVE_ANY); - rights = rights_string(r); - } else - rights = config->default_rights; - return create_user(user, password, rights, 0/*email*/, 0/*confirmation*/, - tid, DB_NOOVERWRITE); -} - /** @brief Create a root user in the user database if there is none */ void trackdb_create_root(void) { int e; diff --git a/lib/xgetdate.c b/lib/xgetdate.c index ae9e183..42e2d5c 100644 --- a/lib/xgetdate.c +++ b/lib/xgetdate.c @@ -119,14 +119,12 @@ xgetdate_r (const char *string, struct tm *tp, const char *const *template) { const char *line; - size_t len; char *result = NULL; time_t timer; struct tm tm; int mday_ok = 0; line = NULL; - len = 0; while((line = *template++)) { /* Do the conversion. */ diff --git a/libtests/Makefile.am b/libtests/Makefile.am index bc1a0d9..96621e3 100644 --- a/libtests/Makefile.am +++ b/libtests/Makefile.am @@ -63,9 +63,9 @@ t_words_SOURCES=t-words.c test.c test.h t_wstat_SOURCES=t-wstat.c test.c test.h t_eventdist_SOURCES=t-eventdist.c test.c test.h t_resample_SOURCES=t-resample.c test.c test.h -t_resample_LDFLAGS=$(LIBSAMPLERATE) +t_resample_LDADD=$(LDADD) $(LIBSAMPLERATE) t_configuration_SOURCES=t-configuration.c test.c test.h -t_configuration_LDFLAGS=$(LIBGCRYPT) +t_configuration_LDADD=$(LDADD) $(LIBGCRYPT) t_timeval_SOURCES=t-timeval.c test.c test.h check-report: before-check check make-coverage-reports diff --git a/libtests/t-eventdist.c b/libtests/t-eventdist.c index 6aa72ef..6880ef0 100644 --- a/libtests/t-eventdist.c +++ b/libtests/t-eventdist.c @@ -76,6 +76,9 @@ static void test_eventdist(void) { check_integer(wibbles, 2); check_integer(wobbles, 2); check_integer(wobble2s, 3); + + event_cancel(wibble_handle); + event_cancel(wobble2_handle); } TEST(eventdist); diff --git a/server/play.c b/server/play.c index a1384f8..b6f67fb 100644 --- a/server/play.c +++ b/server/play.c @@ -340,8 +340,6 @@ static int start(ev_source *ev, static int start_child(struct queue_entry *q, const struct pbgc_params *params, void attribute((unused)) *bgdata) { - int n; - /* Play the track */ play_track(q->pl, params->argv, params->argc, -- [mdw]