From: Andre Noll Date: Wed, 31 Jan 2007 10:44:50 +0000 (+0100) Subject: Merge ../paraslash_meins/paraslash X-Git-Tag: v0.2.15~28^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=2e8b7f42a30ebe41c862cc603c8f746b1e202479;hp=01abb81034eed7a0ed65667ebfead9b32a5c7ba0 Merge ../paraslash_meins/paraslash --- diff --git a/Makefile.in b/Makefile.in index 39e926e7..b468cc84 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,9 +22,9 @@ DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W DEBUG_CPPFLAGS += -Wredundant-decls # produces false positives # DEBUG_CPPFLAGS += -Wunreachable-code -#CPPFLAGS += -Wwrite-strings +# DEBUG_CPPFLAGS += -Wwrite-strings # invalid option for gcc-3.3.5 -# CPPFLAGS += -Wextra +# DEBUG_CPPFLAGS += -Wextra CPPFLAGS += -Os CPPFLAGS += -Wall @@ -199,9 +199,6 @@ aac_common.o: aac_common.c aac_afh.o: aac_afh.c $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $< -para_recv: @recv_objs@ - $(CC) @recv_objs@ -o $@ @recv_ldflags@ - slider.o: slider.c $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@ @GTK_CFLAGS@ $< @@ -209,13 +206,16 @@ krell.o: krell.c $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c mysql_selector.o: mysql_selector.c - $(CC) -Wall -O -g @mysql_cppflags@ -c -o $@ $< + $(CC) -c $(DEBUG_CPPFLAGS) -Wall -O -g @mysql_cppflags@ $< %.cmdline.o: %.cmdline.c $(CC) -c $(CPPFLAGS) $< %.o: %.c $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $< +para_recv: @recv_objs@ + $(CC) @recv_objs@ -o $@ @recv_ldflags@ + para_filter: @filter_objs@ $(CC) @filter_objs@ -o $@ @filter_ldflags@ diff --git a/alsa_write.c b/alsa_write.c index 705713b9..7c090c89 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -212,7 +212,7 @@ static void alsa_close(struct writer_node *wn) free(pad); } -__malloc void *alsa_parse_config(char *options) +__malloc static void *alsa_parse_config(const char *options) { struct alsa_write_args_info *conf = para_calloc(sizeof(struct alsa_write_args_info)); diff --git a/audiod.c b/audiod.c index e6e90418..9009123a 100644 --- a/audiod.c +++ b/audiod.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andre Noll + * Copyright (C) 2005-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/audiod_command.c b/audiod_command.c index 2fa7eb14..3bb94ad6 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2007 Andre Noll + * Copyright (C) 2005-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/file_write.c b/file_write.c index 2163b7a9..20215264 100644 --- a/file_write.c +++ b/file_write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Andre Noll + * Copyright (C) 2006-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,7 +102,7 @@ static void file_write_close(struct writer_node *wn) free(pfwd); } -__malloc void *file_write_parse_config(char *options) +__malloc static void *file_write_parse_config(const char *options) { PARA_INFO_LOG("options: %s\n", options); struct file_write_args_info *conf diff --git a/mysql_selector.c b/mysql_selector.c index e2812fd7..0eb19bc5 100644 --- a/mysql_selector.c +++ b/mysql_selector.c @@ -766,7 +766,7 @@ out: */ static char *get_selector_info(char *name) { - char *meta = NULL, *atts = NULL, *info, *dir = NULL, *query, *stream = NULL; + char *meta, *atts, *info, *dir, *query, *stream; void *result = NULL; MYSQL_ROW row = NULL; @@ -792,14 +792,10 @@ write: stream, meta, (result && row && row[0])? row[0] : "(no score)", atts); - if (dir) - free(dir); - if (meta) - free(meta); - if (atts) - free(atts); - if (stream) - free(stream); + free(dir); + free(meta); + free(atts); + free(stream); if (result) mysql_free_result(result); return info; @@ -2156,8 +2152,15 @@ static void shutdown_connection(void) /** * the init function of the mysql-based audio file selector * - * Check the command line options and initialize all function pointers of \a db. - * Connect to the mysql server and initialize the info string. + * \param db pointer to the struct to initialize + * + * Check the command line options and initialize all function pointers of \a + * db. Connect to the mysql server and initialize the info string. + * + * \return This function returns success even if it could not connect + * to the mysql server. This is because the connect is expected to fail + * if there the paraslash database is not yet created. This gives the + * user a chance to send the "cdb" to create the database. * * \sa struct audio_file_selector, misc_meta_data::selector_info, * random_selector.c diff --git a/osx_write.c b/osx_write.c index f2e5c485..95a84f2a 100644 --- a/osx_write.c +++ b/osx_write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Andre Noll + * Copyright (C) 2006-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -247,7 +247,7 @@ e0: return ret; } -__malloc void *osx_write_parse_config(char *options) +__malloc static void *osx_write_parse_config(const char *options) { struct osx_write_args_info *conf = para_calloc(sizeof(struct osx_write_args_info)); diff --git a/server.ggo b/server.ggo index e5238dbd..2c3ff1d0 100644 --- a/server.ggo +++ b/server.ggo @@ -38,11 +38,11 @@ privileges right after parsing the command line options, but before parsing the configuration file. In this case, real/effective/saved UID are all set to the -UID of 'username'. As the configuration file +UID of 'name'. As the configuration file is read afterwards, those options that have a default value depending on the UID (e.g. the directory for the configuration file) are -computed by using the uid of 'username'. +computed by using the uid of 'name'. This option has no effect if para_server is started as a non-root user (i.e. EUID != 0)" @@ -59,7 +59,7 @@ Otherwise, real/effective GID and the saved set-group ID are all set to the GID given by 'group'. Must not be given in the config file." - string typestr="groupname" + string typestr="group" optional diff --git a/write.h b/write.h index 63efbfed..9f236634 100644 --- a/write.h +++ b/write.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Andre Noll + * Copyright (C) 2006-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ struct writer { * more than once with different values of \a options. * */ - void * (*parse_config)(char *options); + void * (*parse_config)(const char *options); /** * * open one instance of this writer diff --git a/write_common.c b/write_common.c index acf1d292..b1ab00cf 100644 --- a/write_common.c +++ b/write_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Andre Noll + * Copyright (C) 2006-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -149,7 +149,7 @@ void init_supported_writers(void) writers[i].init(&writers[i]); } -void *check_writer_arg(char *wa, int *writer_num) +void *check_writer_arg(const char *wa, int *writer_num) { int i;