]> code.delx.au - pulseaudio/commitdiff
client-conf: Remove redundant function parameters
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Wed, 19 Mar 2014 10:19:07 +0000 (12:19 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 28 Mar 2014 12:58:14 +0000 (14:58 +0200)
src/daemon/main.c
src/daemon/server-lookup.c
src/pulse/client-conf-x11.c
src/pulse/client-conf-x11.h
src/pulse/client-conf.c
src/pulse/client-conf.h
src/pulse/context.c
src/utils/pax11publish.c

index e01371ed5ea65ed8880b9f141564080632386858..02a8ea6493d6c64911ebf5af47dbdaff757e7459 100644 (file)
@@ -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);
 
index 82c88510a9c9ae05d47d769c4a93679ad8a368e9..1f088e6de45de0617a8d95d477c52907ee61c480 100644 (file)
@@ -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;
     }
index 8d0c612b63e9b286b02435b2da00fac7d050ed66..b37f83776595ae9b607ea18299797d6a2045ee7e 100644 (file)
 
 #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)
index dca9f0d2e88610a4bf774c1c6eaad05c2ed41863..3d1dea0c73429235ddf79b51ba3bf9ff6a3702e4 100644 (file)
@@ -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
index ee0271b2eeef676220681aa8f7b71cce2d857e09..ea583a335d2b0e5366e271f086decb25a6745529 100644 (file)
@@ -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;
 
index 87d42d80ac9a05abbf647faa61433e51f584d6c5..c6c74cadeed93d13f2c1510f5e27780cb0c4b460 100644 (file)
@@ -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. */
index b78df27c272eb6466ec8f7914c57abaf6ea80cef..761d13c8e624bad612738cdea72ec2990a489ebc 100644 (file)
@@ -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);
 
index abb23120d0c6becc36b618b010b5a52dfebe945e..f79975dd0c49f804c318116cdf9cee589de25551 100644 (file)
@@ -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;
             }