[pulseaudio-commits] 4 commits - src/modules src/pulsecore src/tests

Colin Guthrie colin at kemper.freedesktop.org
Sun Nov 27 07:44:17 PST 2011


 src/modules/x11/module-x11-xsmp.c |    2 +-
 src/pulsecore/cli-command.c       |    2 +-
 src/pulsecore/device-port.h       |    2 --
 src/pulsecore/dynarray.c          |    4 ++--
 src/pulsecore/dynarray.h          |    4 ++--
 src/pulsecore/pstream.c           |    8 ++++----
 src/pulsecore/queue.c             |    4 ++--
 src/pulsecore/queue.h             |    4 ++--
 src/pulsecore/sink.c              |    4 ++--
 src/pulsecore/source.c            |    4 ++--
 src/pulsecore/tokenizer.c         |    6 +-----
 src/tests/queue-test.c            |    2 +-
 12 files changed, 20 insertions(+), 26 deletions(-)

New commits:
commit 5958208c261fb81f880a5b712ca802188e4c7535
Author: Colin Guthrie <colin at mageia.org>
Date:   Sun Nov 27 15:44:23 2011 +0000

    device-port: Remove redundant include after the better circular dep fix.

diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
index b634125..ee4fc3e 100644
--- a/src/pulsecore/device-port.h
+++ b/src/pulsecore/device-port.h
@@ -63,8 +63,6 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des
 
 void pa_device_port_hashmap_free(pa_hashmap *h);
 
-#include <pulsecore/core.h>
-
 /* The port's available status has changed */
 void pa_device_port_set_available(pa_device_port *p, pa_port_available_t available);
 

commit 8969bccdd9fb1b901fa4e5af27de38cf7c9fac77
Author: Colin Guthrie <colin at mageia.org>
Date:   Sun Nov 27 15:23:55 2011 +0000

    x11: Drop unneeded 'struct' and use the typedef directly.

diff --git a/src/modules/x11/module-x11-xsmp.c b/src/modules/x11/module-x11-xsmp.c
index 6a6116f..765eff0 100644
--- a/src/modules/x11/module-x11-xsmp.c
+++ b/src/modules/x11/module-x11-xsmp.c
@@ -96,7 +96,7 @@ static void ice_io_cb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_fla
 }
 
 static void new_ice_connection(IceConn connection, IcePointer client_data, Bool opening, IcePointer *watch_data) {
-    struct pa_core *c = client_data;
+    pa_core *c = client_data;
 
     if (opening)
         *watch_data = c->mainloop->io_new(

commit cbb3a8a61c5c83ba5a9e7fbd5190aec1c862bce2
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Fri Nov 18 09:58:09 2011 +0100

    Use simple free function in pa_queue_free

diff --git a/src/pulsecore/pstream.c b/src/pulsecore/pstream.c
index b08f6a6..99eb02e 100644
--- a/src/pulsecore/pstream.c
+++ b/src/pulsecore/pstream.c
@@ -279,7 +279,7 @@ pa_pstream *pa_pstream_new(pa_mainloop_api *m, pa_iochannel *io, pa_mempool *poo
     return p;
 }
 
-static void item_free(void *item, void *q) {
+static void item_free(void *item) {
     struct item_info *i = item;
     pa_assert(i);
 
@@ -300,10 +300,10 @@ static void pstream_free(pa_pstream *p) {
 
     pa_pstream_unlink(p);
 
-    pa_queue_free(p->send_queue, item_free, NULL);
+    pa_queue_free(p->send_queue, item_free);
 
     if (p->write.current)
-        item_free(p->write.current, NULL);
+        item_free(p->write.current);
 
     if (p->write.memchunk.memblock)
         pa_memblock_unref(p->write.memchunk.memblock);
@@ -607,7 +607,7 @@ static int do_write(pa_pstream *p) {
 
     if (p->write.index >= PA_PSTREAM_DESCRIPTOR_SIZE + ntohl(p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH])) {
         pa_assert(p->write.current);
-        item_free(p->write.current, NULL);
+        item_free(p->write.current);
         p->write.current = NULL;
 
         if (p->write.memchunk.memblock)
diff --git a/src/pulsecore/queue.c b/src/pulsecore/queue.c
index 2c73a3d..f4216ee 100644
--- a/src/pulsecore/queue.c
+++ b/src/pulsecore/queue.c
@@ -52,13 +52,13 @@ pa_queue* pa_queue_new(void) {
     return q;
 }
 
-void pa_queue_free(pa_queue* q, pa_free2_cb_t free_func, void *userdata) {
+void pa_queue_free(pa_queue *q, pa_free_cb_t free_func) {
     void *data;
     pa_assert(q);
 
     while ((data = pa_queue_pop(q)))
         if (free_func)
-            free_func(data, userdata);
+            free_func(data);
 
     pa_assert(!q->front);
     pa_assert(!q->back);
diff --git a/src/pulsecore/queue.h b/src/pulsecore/queue.h
index f3cec9b..1b95ec8 100644
--- a/src/pulsecore/queue.h
+++ b/src/pulsecore/queue.h
@@ -22,7 +22,7 @@
   USA.
 ***/
 
-#include <pulsecore/idxset.h>
+#include <pulse/def.h>
 
 typedef struct pa_queue pa_queue;
 
@@ -33,7 +33,7 @@ pa_queue* pa_queue_new(void);
 
 /* Free the queue and run the specified callback function for every
  * remaining entry. The callback function may be NULL. */
-void pa_queue_free(pa_queue* q, pa_free2_cb_t free_func, void *userdata);
+void pa_queue_free(pa_queue *q, pa_free_cb_t free_func);
 
 void pa_queue_push(pa_queue *q, void *p);
 void* pa_queue_pop(pa_queue *q);
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index aa547f9..9a43a1c 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -863,7 +863,7 @@ void pa_sink_move_all_finish(pa_sink *s, pa_queue *q, pa_bool_t save) {
         pa_sink_input_unref(i);
     }
 
-    pa_queue_free(q, NULL, NULL);
+    pa_queue_free(q, NULL);
 }
 
 /* Called from main context */
@@ -878,7 +878,7 @@ void pa_sink_move_all_fail(pa_queue *q) {
         pa_sink_input_unref(i);
     }
 
-    pa_queue_free(q, NULL, NULL);
+    pa_queue_free(q, NULL);
 }
 
 /* Called from IO thread context */
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index d6b3b76..14e04ed 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -800,7 +800,7 @@ void pa_source_move_all_finish(pa_source *s, pa_queue *q, pa_bool_t save) {
         pa_source_output_unref(o);
     }
 
-    pa_queue_free(q, NULL, NULL);
+    pa_queue_free(q, NULL);
 }
 
 /* Called from main context */
@@ -815,7 +815,7 @@ void pa_source_move_all_fail(pa_queue *q) {
         pa_source_output_unref(o);
     }
 
-    pa_queue_free(q, NULL, NULL);
+    pa_queue_free(q, NULL);
 }
 
 /* Called from IO thread context */
diff --git a/src/tests/queue-test.c b/src/tests/queue-test.c
index b21775e..6b3e895 100644
--- a/src/tests/queue-test.c
+++ b/src/tests/queue-test.c
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]) {
     pa_queue_push(q, (void*) "sechs");
     pa_queue_push(q, (void*) "sieben");
 
-    pa_queue_free(q, NULL, NULL);
+    pa_queue_free(q, NULL);
 
     return 0;
 }

commit e45b02de5549eb3da68b6603dcc11e52d7bc507b
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Fri Nov 18 09:58:08 2011 +0100

    Use simple free function in pa_dynarray_free

diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index c38637d..a43b7ca 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -1800,7 +1800,7 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
                             sorted_files = pa_xnew(char*, count);
                             for (i = 0; i < count; ++i)
                                 sorted_files[i] = pa_dynarray_get(files, i);
-                            pa_dynarray_free(files, NULL, NULL);
+                            pa_dynarray_free(files, NULL);
 
                             for (i = 0; i < count; ++i) {
                                 for (unsigned j = 0; j < count; ++j) {
diff --git a/src/pulsecore/dynarray.c b/src/pulsecore/dynarray.c
index 69d835a..78b2eb9 100644
--- a/src/pulsecore/dynarray.c
+++ b/src/pulsecore/dynarray.c
@@ -50,14 +50,14 @@ pa_dynarray* pa_dynarray_new(void) {
     return a;
 }
 
-void pa_dynarray_free(pa_dynarray* a, pa_free2_cb_t free_func, void *userdata) {
+void pa_dynarray_free(pa_dynarray *a, pa_free_cb_t free_func) {
     unsigned i;
     pa_assert(a);
 
     if (free_func)
         for (i = 0; i < a->n_entries; i++)
             if (a->data[i])
-                free_func(a->data[i], userdata);
+                free_func(a->data[i]);
 
     pa_xfree(a->data);
     pa_xfree(a);
diff --git a/src/pulsecore/dynarray.h b/src/pulsecore/dynarray.h
index 9a8e64e..70deebb 100644
--- a/src/pulsecore/dynarray.h
+++ b/src/pulsecore/dynarray.h
@@ -22,7 +22,7 @@
   USA.
 ***/
 
-#include <pulsecore/idxset.h>
+#include <pulse/def.h>
 
 typedef struct pa_dynarray pa_dynarray;
 
@@ -34,7 +34,7 @@ pa_dynarray* pa_dynarray_new(void);
 
 /* Free the array calling the specified function for every entry in
  * the array. The function may be NULL. */
-void pa_dynarray_free(pa_dynarray* a, pa_free2_cb_t free_func, void *userdata);
+void pa_dynarray_free(pa_dynarray *a, pa_free_cb_t free_func);
 
 /* Store p at position i in the array */
 void pa_dynarray_put(pa_dynarray*a, unsigned i, void *p);
diff --git a/src/pulsecore/tokenizer.c b/src/pulsecore/tokenizer.c
index a0ade69..cb682d6 100644
--- a/src/pulsecore/tokenizer.c
+++ b/src/pulsecore/tokenizer.c
@@ -33,10 +33,6 @@
 
 #include "tokenizer.h"
 
-static void token_free(void *p, void *userdata) {
-    pa_xfree(p);
-}
-
 static void parse(pa_dynarray*a, const char *s, unsigned args) {
     int infty = 0;
     const char delimiter[] = " \t\n\r";
@@ -76,7 +72,7 @@ void pa_tokenizer_free(pa_tokenizer *t) {
     pa_dynarray *a = (pa_dynarray*) t;
 
     pa_assert(a);
-    pa_dynarray_free(a, token_free, NULL);
+    pa_dynarray_free(a, pa_xfree);
 }
 
 const char *pa_tokenizer_get(pa_tokenizer *t, unsigned i) {



More information about the pulseaudio-commits mailing list