chiark / gitweb /
build: various fixes for ubuntu 12.10/gcc 4.7
authorRichard Kettlewell <rjk@terraraq.org.uk>
Sat, 1 Dec 2012 11:20:14 +0000 (11:20 +0000)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Sat, 1 Dec 2012 11:20:14 +0000 (11:20 +0000)
- 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
lib/xgetdate.c
libtests/Makefile.am
libtests/t-eventdist.c
server/play.c

index aa9ad56a4c90abe98c35ea0a931ec40f01c9143f..7fbdeb5817debecb902306176468d1b4cf6191a1 100644 (file)
@@ -3047,40 +3047,6 @@ static int create_user(const char *user,
   return trackdb_putdata(trackdb_usersdb, user, k, tid, flags);
 }
 
   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;
 /** @brief Create a root user in the user database if there is none */
 void trackdb_create_root(void) {
   int e;
index ae9e183ab448518a68887a67b1afc9c48cae9cfa..42e2d5cd43ce21514f394deb7411eb8b559fa76c 100644 (file)
@@ -119,14 +119,12 @@ xgetdate_r (const char *string, struct tm *tp,
            const char *const *template)
 {
   const char *line;
            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;
   char *result = NULL;
   time_t timer;
   struct tm tm;
   int mday_ok = 0;
 
   line = NULL;
-  len = 0;
   while((line = *template++))
     {
       /* Do the conversion.  */
   while((line = *template++))
     {
       /* Do the conversion.  */
index bc1a0d935e5881d55570c082fc37c3edcc23650d..96621e3c2cd734861d998a75e7c89b5d77170c60 100644 (file)
@@ -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_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_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
 t_timeval_SOURCES=t-timeval.c test.c test.h
 
 check-report: before-check check make-coverage-reports
index 6aa72ef62714cc9e6f373c99ecb4937ff8eb52ce..6880ef0c6e5b163ff936c2a1d57e8a71dbd4e62e 100644 (file)
@@ -76,6 +76,9 @@ static void test_eventdist(void) {
   check_integer(wibbles, 2);
   check_integer(wobbles, 2);
   check_integer(wobble2s, 3);
   check_integer(wibbles, 2);
   check_integer(wobbles, 2);
   check_integer(wobble2s, 3);
+
+  event_cancel(wibble_handle);
+  event_cancel(wobble2_handle);
 }
 
 TEST(eventdist);
 }
 
 TEST(eventdist);
index a1384f87f5160f765de0732c4483a2b357f0fd0f..b6f67fb82a5b703e238472e2ebaf1a4ca6f416a6 100644 (file)
@@ -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) {
 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,
   /* Play the track */
   play_track(q->pl,
              params->argv, params->argc,