summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-19 12:19:07 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-28 14:58:14 +0200
commit0a583fe0c330d167f52784585afffdd8065a92cd (patch)
tree4d0c0e61c6d281c739e071583ee85c1640581e4b
parentaca30527e2f8241b52433a81f7e857b726d5093c (diff)
client-conf: Remove redundant function parameters
-rw-r--r--src/daemon/main.c4
-rw-r--r--src/daemon/server-lookup.c2
-rw-r--r--src/pulse/client-conf-x11.c5
-rw-r--r--src/pulse/client-conf-x11.h6
-rw-r--r--src/pulse/client-conf.c18
-rw-r--r--src/pulse/client-conf.h7
-rw-r--r--src/pulse/context.c4
-rw-r--r--src/utils/pax11publish.c2
8 files changed, 18 insertions, 30 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index e01371ed5..02a8ea649 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -346,9 +346,9 @@ static char *check_configured_address(void) {
char *default_server = NULL;
pa_client_conf *c = pa_client_conf_new();
- pa_client_conf_load(c, NULL);
+ pa_client_conf_load(c);
#ifdef HAVE_X11
- pa_client_conf_from_x11(c, NULL);
+ pa_client_conf_from_x11(c);
#endif
pa_client_conf_env(c);
diff --git a/src/daemon/server-lookup.c b/src/daemon/server-lookup.c
index 82c88510a..1f088e6de 100644
--- a/src/daemon/server-lookup.c
+++ b/src/daemon/server-lookup.c
@@ -126,7 +126,7 @@ static enum get_address_result_t get_address(pa_server_type_t server_type, char
*address = NULL;
- if (pa_client_conf_load(conf, NULL) < 0) {
+ if (pa_client_conf_load(conf) < 0) {
r = FAILED_TO_LOAD_CLIENT_CONF;
goto finish;
}
diff --git a/src/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c
index 8d0c612b6..b37f83776 100644
--- a/src/pulse/client-conf-x11.c
+++ b/src/pulse/client-conf-x11.c
@@ -37,14 +37,15 @@
#include "client-conf-x11.h"
-int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
+int pa_client_conf_from_x11(pa_client_conf *c) {
+ const char *dname;
xcb_connection_t *xcb = NULL;
int ret = -1, screen = 0;
char t[1024];
pa_assert(c);
- if (!dname && !(dname = getenv("DISPLAY")))
+ if (!(dname = getenv("DISPLAY")))
goto finish;
if (*dname == 0)
diff --git a/src/pulse/client-conf-x11.h b/src/pulse/client-conf-x11.h
index dca9f0d2e..3d1dea0c7 100644
--- a/src/pulse/client-conf-x11.h
+++ b/src/pulse/client-conf-x11.h
@@ -24,8 +24,8 @@
#include "client-conf.h"
-/* Load client configuration data from the specified X11 display,
- * overwriting the current settings in *c */
-int pa_client_conf_from_x11(pa_client_conf *c, const char *display);
+/* Load client configuration data from X11, overwriting the current settings in
+ * *c. */
+int pa_client_conf_from_x11(pa_client_conf *c);
#endif
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index ee0271b2e..ea583a335 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -90,7 +90,7 @@ void pa_client_conf_free(pa_client_conf *c) {
pa_xfree(c);
}
-int pa_client_conf_load(pa_client_conf *c, const char *filename) {
+int pa_client_conf_load(pa_client_conf *c) {
FILE *f = NULL;
char *fn = NULL;
int r = -1;
@@ -113,21 +113,9 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) {
{ NULL, NULL, NULL, NULL },
};
- if (filename) {
-
- if (!(f = pa_fopen_cloexec(filename, "r"))) {
- pa_log(_("Failed to open configuration file '%s': %s"), fn, pa_cstrerror(errno));
+ if (!(f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn)))
+ if (errno != ENOENT)
goto finish;
- }
-
- fn = pa_xstrdup(fn);
-
- } else {
-
- if (!(f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn)))
- if (errno != ENOENT)
- goto finish;
- }
r = f ? pa_config_parse(fn, f, table, NULL, NULL) : 0;
diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
index 87d42d80a..c6c74cade 100644
--- a/src/pulse/client-conf.h
+++ b/src/pulse/client-conf.h
@@ -39,10 +39,9 @@ typedef struct pa_client_conf {
pa_client_conf *pa_client_conf_new(void);
void pa_client_conf_free(pa_client_conf *c);
-/* Load the configuration data from the specified file, overwriting
- * the current settings in *c. When the filename is NULL, the
- * default client configuration file name is used. */
-int pa_client_conf_load(pa_client_conf *c, const char *filename);
+/* Load the configuration data from the client configuration file, overwriting
+ * the current settings in *c. */
+int pa_client_conf_load(pa_client_conf *c);
/* Load the configuration data from the environment of the current
process, overwriting the current settings in *c. */
diff --git a/src/pulse/context.c b/src/pulse/context.c
index b78df27c2..761d13c8e 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -166,9 +166,9 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
#endif
c->conf = pa_client_conf_new();
- pa_client_conf_load(c->conf, NULL);
+ pa_client_conf_load(c->conf);
#ifdef HAVE_X11
- pa_client_conf_from_x11(c->conf, NULL);
+ pa_client_conf_from_x11(c->conf);
#endif
pa_client_conf_env(c->conf);
diff --git a/src/utils/pax11publish.c b/src/utils/pax11publish.c
index abb23120d..f79975dd0 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.c
@@ -152,7 +152,7 @@ int main(int argc, char *argv[]) {
char hx[PA_NATIVE_COOKIE_LENGTH*2+1];
assert(conf);
- if (pa_client_conf_load(conf, NULL) < 0) {
+ if (pa_client_conf_load(conf) < 0) {
fprintf(stderr, _("Failed to load client configuration file.\n"));
goto finish;
}