[pulseaudio-commits] r1798 - in /branches/lennart/src/pulse: channelmap.c client-conf-x11.c client-conf.c mainloop-api.c mainloop.c operation.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Sep 10 17:24:11 PDT 2007


Author: lennart
Date: Tue Sep 11 02:24:10 2007
New Revision: 1798

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1798&root=pulseaudio&view=rev
Log:
more s/assert/pa_assert/ modernizations

Modified:
    branches/lennart/src/pulse/channelmap.c
    branches/lennart/src/pulse/client-conf-x11.c
    branches/lennart/src/pulse/client-conf.c
    branches/lennart/src/pulse/mainloop-api.c
    branches/lennart/src/pulse/mainloop.c
    branches/lennart/src/pulse/operation.c

Modified: branches/lennart/src/pulse/channelmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/channelmap.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/channelmap.c (original)
+++ branches/lennart/src/pulse/channelmap.c Tue Sep 11 02:24:10 2007
@@ -27,12 +27,12 @@
 #endif
 
 #include <stdlib.h>
-#include <assert.h>
 #include <stdio.h>
 #include <string.h>
 
 #include <pulse/xmalloc.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/macro.h>
 
 #include "channelmap.h"
 
@@ -164,7 +164,7 @@
 
 pa_channel_map* pa_channel_map_init(pa_channel_map *m) {
     unsigned c;
-    assert(m);
+    pa_assert(m);
 
     m->channels = 0;
 
@@ -175,7 +175,7 @@
 }
 
 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m) {
-    assert(m);
+    pa_assert(m);
 
     pa_channel_map_init(m);
 
@@ -185,7 +185,7 @@
 }
 
 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m) {
-    assert(m);
+    pa_assert(m);
 
     pa_channel_map_init(m);
 
@@ -196,9 +196,9 @@
 }
 
 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def) {
-    assert(m);
-    assert(channels > 0);
-    assert(channels <= PA_CHANNELS_MAX);
+    pa_assert(m);
+    pa_assert(channels > 0);
+    pa_assert(channels <= PA_CHANNELS_MAX);
 
     pa_channel_map_init(m);
 
@@ -415,8 +415,8 @@
 int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) {
     unsigned c;
 
-    assert(a);
-    assert(b);
+    pa_assert(a);
+    pa_assert(b);
 
     if (a->channels != b->channels)
         return 0;
@@ -433,9 +433,9 @@
     int first = 1;
     char *e;
 
-    assert(s);
-    assert(l > 0);
-    assert(map);
+    pa_assert(s);
+    pa_assert(l > 0);
+    pa_assert(map);
 
     *(e = s) = 0;
 
@@ -456,8 +456,8 @@
     pa_channel_map map;
     char *p;
 
-    assert(rmap);
-    assert(s);
+    pa_assert(rmap);
+    pa_assert(s);
 
     memset(&map, 0, sizeof(map));
 
@@ -517,7 +517,7 @@
 int pa_channel_map_valid(const pa_channel_map *map) {
     unsigned c;
 
-    assert(map);
+    pa_assert(map);
 
     if (map->channels <= 0 || map->channels > PA_CHANNELS_MAX)
         return 0;

Modified: branches/lennart/src/pulse/client-conf-x11.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/client-conf-x11.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/client-conf-x11.c (original)
+++ branches/lennart/src/pulse/client-conf-x11.c Tue Sep 11 02:24:10 2007
@@ -26,7 +26,6 @@
 #endif
 
 #include <string.h>
-#include <assert.h>
 
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
@@ -36,6 +35,7 @@
 #include <pulsecore/x11prop.h>
 #include <pulsecore/log.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/macro.h>
 
 #include "client-conf-x11.h"
 
@@ -43,6 +43,8 @@
     Display *d = NULL;
     int ret = -1;
     char t[1024];
+
+    pa_assert(c);
 
     if (!dname && (!(dname = getenv("DISPLAY")) || *dname == '\0'))
         goto finish;
@@ -75,7 +77,7 @@
             goto finish;
         }
 
-        assert(sizeof(cookie) == sizeof(c->cookie));
+        pa_assert(sizeof(cookie) == sizeof(c->cookie));
         memcpy(c->cookie, cookie, sizeof(cookie));
 
         c->cookie_valid = 1;

Modified: branches/lennart/src/pulse/client-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/client-conf.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/client-conf.c (original)
+++ branches/lennart/src/pulse/client-conf.c Tue Sep 11 02:24:10 2007
@@ -27,14 +27,14 @@
 #endif
 
 #include <stdlib.h>
-#include <assert.h>
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
-#include <pulsecore/core-error.h>
 #include <pulse/xmalloc.h>
 
+#include <pulsecore/macro.h>
+#include <pulsecore/core-error.h>
 #include <pulsecore/log.h>
 #include <pulsecore/conf-parser.h>
 #include <pulsecore/core-util.h>
@@ -81,7 +81,7 @@
 }
 
 void pa_client_conf_free(pa_client_conf *c) {
-    assert(c);
+    pa_assert(c);
     pa_xfree(c->daemon_binary);
     pa_xfree(c->extra_arguments);
     pa_xfree(c->default_sink);
@@ -90,6 +90,7 @@
     pa_xfree(c->cookie_file);
     pa_xfree(c);
 }
+
 int pa_client_conf_load(pa_client_conf *c, const char *filename) {
     FILE *f = NULL;
     char *fn = NULL;
@@ -122,7 +123,7 @@
         pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn, "r");
 
     if (!f && errno != EINTR) {
-        pa_log("WARNING: failed to open configuration file '%s': %s", fn, pa_cstrerror(errno));
+        pa_log_warn("WARNING: failed to open configuration file '%s': %s", fn, pa_cstrerror(errno));
         goto finish;
     }
 
@@ -175,7 +176,7 @@
 }
 
 int pa_client_conf_load_cookie(pa_client_conf* c) {
-    assert(c);
+    pa_assert(c);
 
     c->cookie_valid = 0;
 

Modified: branches/lennart/src/pulse/mainloop-api.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/mainloop-api.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/mainloop-api.c (original)
+++ branches/lennart/src/pulse/mainloop-api.c Tue Sep 11 02:24:10 2007
@@ -25,12 +25,12 @@
 #include <config.h>
 #endif
 
-#include <assert.h>
 #include <stdlib.h>
 
 #include <pulse/xmalloc.h>
 
 #include <pulsecore/gccmacro.h>
+#include <pulsecore/macro.h>
 
 #include "mainloop-api.h"
 
@@ -41,32 +41,38 @@
 
 static void once_callback(pa_mainloop_api *m, pa_defer_event *e, void *userdata) {
     struct once_info *i = userdata;
-    assert(m && i && i->callback);
-
+    
+    pa_assert(m);
+    pa_assert(i);
+    
+    pa_assert(i->callback);
     i->callback(m, i->userdata);
 
-    assert(m->defer_free);
+    pa_assert(m->defer_free);
     m->defer_free(e);
 }
 
 static void free_callback(pa_mainloop_api *m, PA_GCC_UNUSED pa_defer_event *e, void *userdata) {
     struct once_info *i = userdata;
-    assert(m && i);
+
+    pa_assert(m);
+    pa_assert(i);
     pa_xfree(i);
 }
 
 void pa_mainloop_api_once(pa_mainloop_api* m, void (*callback)(pa_mainloop_api *m, void *userdata), void *userdata) {
     struct once_info *i;
     pa_defer_event *e;
-    assert(m && callback);
+
+    pa_assert(m);
+    pa_assert(callback);
 
     i = pa_xnew(struct once_info, 1);
     i->callback = callback;
     i->userdata = userdata;
 
-    assert(m->defer_new);
-    e = m->defer_new(m, once_callback, i);
-    assert(e);
+    pa_assert(m->defer_new);
+    pa_assert_se(e = m->defer_new(m, once_callback, i));
     m->defer_set_destroy(e, free_callback);
 }
 

Modified: branches/lennart/src/pulse/mainloop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/mainloop.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/mainloop.c (original)
+++ branches/lennart/src/pulse/mainloop.c Tue Sep 11 02:24:10 2007
@@ -31,29 +31,28 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <assert.h>
 #include <fcntl.h>
 #include <errno.h>
 
 #ifdef HAVE_SYS_POLL_H
 #include <sys/poll.h>
 #else
-#include "../pulsecore/poll.h"
+#include <pulsecore/poll.h>
 #endif
 
-#include "../pulsecore/winsock.h"
-
 #ifndef HAVE_PIPE
-#include "../pulsecore/pipe.h"
+#include <pulsecore/pipe.h>
 #endif
 
-#include <pulsecore/core-error.h>
 #include <pulse/timeval.h>
 #include <pulse/xmalloc.h>
 
 #include <pulsecore/core-util.h>
 #include <pulsecore/llist.h>
 #include <pulsecore/log.h>
+#include <pulsecore/core-error.h>
+#include <pulsecore/winsock.h>
+#include <pulsecore/macro.h>
 
 #include "mainloop.h"
 
@@ -161,13 +160,13 @@
     pa_mainloop *m;
     pa_io_event *e;
 
-    assert(a);
-    assert(a->userdata);
-    assert(fd >= 0);
-    assert(callback);
+    pa_assert(a);
+    pa_assert(a->userdata);
+    pa_assert(fd >= 0);
+    pa_assert(callback);
 
     m = a->userdata;
-    assert(a == &m->api);
+    pa_assert(a == &m->api);
 
     e = pa_xnew(pa_io_event, 1);
     e->mainloop = m;
@@ -211,8 +210,8 @@
 }
 
 static void mainloop_io_enable(pa_io_event *e, pa_io_event_flags_t events) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     if (e->events == events)
         return;
@@ -228,8 +227,8 @@
 }
 
 static void mainloop_io_free(pa_io_event *e) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     e->dead = 1;
     e->mainloop->io_events_please_scan ++;
@@ -241,7 +240,7 @@
 }
 
 static void mainloop_io_set_destroy(pa_io_event *e, pa_io_event_destroy_cb_t callback) {
-    assert(e);
+    pa_assert(e);
 
     e->destroy_callback = callback;
 }
@@ -255,12 +254,12 @@
     pa_mainloop *m;
     pa_defer_event *e;
 
-    assert(a);
-    assert(a->userdata);
-    assert(callback);
+    pa_assert(a);
+    pa_assert(a->userdata);
+    pa_assert(callback);
 
     m = a->userdata;
-    assert(a == &m->api);
+    pa_assert(a == &m->api);
 
     e = pa_xnew(pa_defer_event, 1);
     e->mainloop = m;
@@ -281,11 +280,11 @@
 }
 
 static void mainloop_defer_enable(pa_defer_event *e, int b) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     if (e->enabled && !b) {
-        assert(e->mainloop->n_enabled_defer_events > 0);
+        pa_assert(e->mainloop->n_enabled_defer_events > 0);
         e->mainloop->n_enabled_defer_events--;
     } else if (!e->enabled && b) {
         e->mainloop->n_enabled_defer_events++;
@@ -296,22 +295,22 @@
 }
 
 static void mainloop_defer_free(pa_defer_event *e) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     e->dead = 1;
     e->mainloop->defer_events_please_scan ++;
 
     if (e->enabled) {
-        assert(e->mainloop->n_enabled_defer_events > 0);
+        pa_assert(e->mainloop->n_enabled_defer_events > 0);
         e->mainloop->n_enabled_defer_events--;
         e->enabled = 0;
     }
 }
 
 static void mainloop_defer_set_destroy(pa_defer_event *e, pa_defer_event_destroy_cb_t callback) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     e->destroy_callback = callback;
 }
@@ -326,12 +325,12 @@
     pa_mainloop *m;
     pa_time_event *e;
 
-    assert(a);
-    assert(a->userdata);
-    assert(callback);
+    pa_assert(a);
+    pa_assert(a->userdata);
+    pa_assert(callback);
 
     m = a->userdata;
-    assert(a == &m->api);
+    pa_assert(a == &m->api);
 
     e = pa_xnew(pa_time_event, 1);
     e->mainloop = m;
@@ -343,7 +342,7 @@
         m->n_enabled_time_events++;
 
         if (m->cached_next_time_event) {
-            assert(m->cached_next_time_event->enabled);
+            pa_assert(m->cached_next_time_event->enabled);
 
             if (pa_timeval_cmp(tv, &m->cached_next_time_event->timeval) < 0)
                 m->cached_next_time_event = e;
@@ -363,11 +362,11 @@
 }
 
 static void mainloop_time_restart(pa_time_event *e, const struct timeval *tv) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     if (e->enabled && !tv) {
-        assert(e->mainloop->n_enabled_time_events > 0);
+        pa_assert(e->mainloop->n_enabled_time_events > 0);
         e->mainloop->n_enabled_time_events--;
     } else if (!e->enabled && tv)
         e->mainloop->n_enabled_time_events++;
@@ -378,7 +377,7 @@
     }
 
     if (e->mainloop->cached_next_time_event && e->enabled) {
-        assert(e->mainloop->cached_next_time_event->enabled);
+        pa_assert(e->mainloop->cached_next_time_event->enabled);
 
         if (pa_timeval_cmp(tv, &e->mainloop->cached_next_time_event->timeval) < 0)
             e->mainloop->cached_next_time_event = e;
@@ -387,14 +386,14 @@
 }
 
 static void mainloop_time_free(pa_time_event *e) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     e->dead = 1;
     e->mainloop->time_events_please_scan ++;
 
     if (e->enabled) {
-        assert(e->mainloop->n_enabled_time_events > 0);
+        pa_assert(e->mainloop->n_enabled_time_events > 0);
         e->mainloop->n_enabled_time_events--;
         e->enabled = 0;
     }
@@ -406,8 +405,8 @@
 }
 
 static void mainloop_time_set_destroy(pa_time_event *e, pa_time_event_destroy_cb_t callback) {
-    assert(e);
-    assert(!e->dead);
+    pa_assert(e);
+    pa_assert(!e->dead);
 
     e->destroy_callback = callback;
 }
@@ -417,10 +416,10 @@
 static void mainloop_quit(pa_mainloop_api*a, int retval) {
     pa_mainloop *m;
 
-    assert(a);
-    assert(a->userdata);
+    pa_assert(a);
+    pa_assert(a->userdata);
     m = a->userdata;
-    assert(a == &m->api);
+    pa_assert(a == &m->api);
 
     pa_mainloop_quit(m, retval);
 }
@@ -506,7 +505,7 @@
             PA_LLIST_REMOVE(pa_io_event, m->io_events, e);
 
             if (e->dead) {
-                assert(m->io_events_please_scan > 0);
+                pa_assert(m->io_events_please_scan > 0);
                 m->io_events_please_scan--;
             }
 
@@ -521,7 +520,7 @@
         e = n;
     }
 
-    assert(m->io_events_please_scan == 0);
+    pa_assert(m->io_events_please_scan == 0);
 }
 
 static void cleanup_time_events(pa_mainloop *m, int force) {
@@ -538,12 +537,12 @@
             PA_LLIST_REMOVE(pa_time_event, m->time_events, e);
 
             if (e->dead) {
-                assert(m->time_events_please_scan > 0);
+                pa_assert(m->time_events_please_scan > 0);
                 m->time_events_please_scan--;
             }
 
             if (!e->dead && e->enabled) {
-                assert(m->n_enabled_time_events > 0);
+                pa_assert(m->n_enabled_time_events > 0);
                 m->n_enabled_time_events--;
                 e->enabled = 0;
             }
@@ -557,7 +556,7 @@
         e = n;
     }
 
-    assert(m->time_events_please_scan == 0);
+    pa_assert(m->time_events_please_scan == 0);
 }
 
 static void cleanup_defer_events(pa_mainloop *m, int force) {
@@ -574,12 +573,12 @@
             PA_LLIST_REMOVE(pa_defer_event, m->defer_events, e);
 
             if (e->dead) {
-                assert(m->defer_events_please_scan > 0);
+                pa_assert(m->defer_events_please_scan > 0);
                 m->defer_events_please_scan--;
             }
 
             if (!e->dead && e->enabled) {
-                assert(m->n_enabled_defer_events > 0);
+                pa_assert(m->n_enabled_defer_events > 0);
                 m->n_enabled_defer_events--;
                 e->enabled = 0;
             }
@@ -593,12 +592,12 @@
         e = n;
     }
 
-    assert(m->defer_events_please_scan == 0);
+    pa_assert(m->defer_events_please_scan == 0);
 }
 
 
 void pa_mainloop_free(pa_mainloop* m) {
-    assert(m);
+    pa_assert(m);
 
     cleanup_io_events(m, 1);
     cleanup_defer_events(m, 1);
@@ -615,7 +614,7 @@
 }
 
 static void scan_dead(pa_mainloop *m) {
-    assert(m);
+    pa_assert(m);
 
     if (m->io_events_please_scan)
         cleanup_io_events(m, 0);
@@ -672,13 +671,13 @@
     pa_io_event *e;
     int r = 0, k;
 
-    assert(m->poll_func_ret > 0);
+    pa_assert(m->poll_func_ret > 0);
 
     for (e = m->io_events, k = m->poll_func_ret; e && !m->quit && k > 0; e = e->next) {
         if (e->dead || !e->pollfd || !e->pollfd->revents)
             continue;
 
-        assert(e->pollfd->fd == e->fd && e->callback);
+        pa_assert(e->pollfd->fd == e->fd && e->callback);
         e->callback(&m->api, e, e->fd, map_flags_from_libc(e->pollfd->revents), e->userdata);
         e->pollfd->revents = 0;
         r++;
@@ -700,7 +699,7 @@
         if (e->dead || !e->enabled)
             continue;
 
-        assert(e->callback);
+        pa_assert(e->callback);
         e->callback(&m->api, e, e->userdata);
         r++;
     }
@@ -710,7 +709,7 @@
 
 static pa_time_event* find_next_time_event(pa_mainloop *m) {
     pa_time_event *t, *n = NULL;
-    assert(m);
+    pa_assert(m);
 
     if (m->cached_next_time_event)
         return m->cached_next_time_event;
@@ -742,7 +741,7 @@
         return -1;
 
     t = find_next_time_event(m);
-    assert(t);
+    pa_assert(t);
 
     if (t->timeval.tv_sec <= 0)
         return 0;
@@ -760,7 +759,7 @@
     pa_time_event *e;
     struct timeval now;
     int r = 0;
-    assert(m);
+    pa_assert(m);
 
     if (m->n_enabled_time_events <= 0)
         return 0;
@@ -773,7 +772,7 @@
             continue;
 
         if (pa_timeval_cmp(&e->timeval, &now) <= 0) {
-            assert(e->callback);
+            pa_assert(e->callback);
 
             /* Disable time event */
             mainloop_time_restart(e, NULL);
@@ -789,7 +788,7 @@
 
 void pa_mainloop_wakeup(pa_mainloop *m) {
     char c = 'W';
-    assert(m);
+    pa_assert(m);
 
     if (m->wakeup_pipe[1] >= 0 && m->state == STATE_POLLING) {
         pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
@@ -800,7 +799,7 @@
 static void clear_wakeup(pa_mainloop *m) {
     char c[10];
 
-    assert(m);
+    pa_assert(m);
 
     if (m->wakeup_pipe[0] < 0)
         return;
@@ -812,8 +811,8 @@
 }
 
 int pa_mainloop_prepare(pa_mainloop *m, int timeout) {
-    assert(m);
-    assert(m->state == STATE_PASSIVE);
+    pa_assert(m);
+    pa_assert(m->state == STATE_PASSIVE);
 
     clear_wakeup(m);
     scan_dead(m);
@@ -839,8 +838,8 @@
 }
 
 int pa_mainloop_poll(pa_mainloop *m) {
-    assert(m);
-    assert(m->state == STATE_PREPARED);
+    pa_assert(m);
+    pa_assert(m->state == STATE_PREPARED);
 
     if (m->quit)
         goto quit;
@@ -850,7 +849,7 @@
     if (m->n_enabled_defer_events )
         m->poll_func_ret = 0;
     else {
-        assert(!m->rebuild_pollfds);
+        pa_assert(!m->rebuild_pollfds);
 
         if (m->poll_func)
             m->poll_func_ret = m->poll_func(m->pollfds, m->n_pollfds, m->prepared_timeout, m->poll_func_userdata);
@@ -876,8 +875,8 @@
 int pa_mainloop_dispatch(pa_mainloop *m) {
     int dispatched = 0;
 
-    assert(m);
-    assert(m->state == STATE_POLLED);
+    pa_assert(m);
+    pa_assert(m->state == STATE_POLLED);
 
     if (m->quit)
         goto quit;
@@ -908,13 +907,13 @@
 }
 
 int pa_mainloop_get_retval(pa_mainloop *m) {
-    assert(m);
+    pa_assert(m);
     return m->retval;
 }
 
 int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval) {
     int r;
-    assert(m);
+    pa_assert(m);
 
     if ((r = pa_mainloop_prepare(m, block ? -1 : 0)) < 0)
         goto quit;
@@ -948,7 +947,7 @@
 }
 
 void pa_mainloop_quit(pa_mainloop *m, int retval) {
-    assert(m);
+    pa_assert(m);
 
     m->quit = 1;
     m->retval = retval;
@@ -956,12 +955,12 @@
 }
 
 pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m) {
-    assert(m);
+    pa_assert(m);
     return &m->api;
 }
 
 void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata) {
-    assert(m);
+    pa_assert(m);
 
     m->poll_func = poll_func;
     m->poll_func_userdata = userdata;

Modified: branches/lennart/src/pulse/operation.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/operation.c?rev=1798&root=pulseaudio&r1=1797&r2=1798&view=diff
==============================================================================
--- branches/lennart/src/pulse/operation.c (original)
+++ branches/lennart/src/pulse/operation.c Tue Sep 11 02:24:10 2007
@@ -25,16 +25,15 @@
 #include <config.h>
 #endif
 
-#include <assert.h>
-
 #include <pulse/xmalloc.h>
+#include <pulsecore/macro.h>
 
 #include "internal.h"
 #include "operation.h"
 
 pa_operation *pa_operation_new(pa_context *c, pa_stream *s, pa_operation_cb_t cb, void *userdata) {
     pa_operation *o;
-    assert(c);
+    pa_assert(c);
 
     o = pa_xnew(pa_operation, 1);
     o->ref = 1;
@@ -53,27 +52,27 @@
 }
 
 pa_operation *pa_operation_ref(pa_operation *o) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     o->ref++;
     return o;
 }
 
 void pa_operation_unref(pa_operation *o) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     if ((--(o->ref)) == 0) {
-        assert(!o->context);
-        assert(!o->stream);
+        pa_assert(!o->context);
+        pa_assert(!o->stream);
         pa_xfree(o);
     }
 }
 
 static void operation_set_state(pa_operation *o, pa_operation_state_t st) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     if (st == o->state)
         return;
@@ -85,7 +84,7 @@
     if ((o->state == PA_OPERATION_DONE) || (o->state == PA_OPERATION_CANCELED)) {
 
         if (o->context) {
-            assert(o->ref >= 2);
+            pa_assert(o->ref >= 2);
 
             PA_LLIST_REMOVE(pa_operation, o->context->operations, o);
             pa_operation_unref(o);
@@ -101,22 +100,22 @@
 }
 
 void pa_operation_cancel(pa_operation *o) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     operation_set_state(o, PA_OPERATION_CANCELED);
 }
 
 void pa_operation_done(pa_operation *o) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     operation_set_state(o, PA_OPERATION_DONE);
 }
 
 pa_operation_state_t pa_operation_get_state(pa_operation *o) {
-    assert(o);
-    assert(o->ref >= 1);
+    pa_assert(o);
+    pa_assert(o->ref >= 1);
 
     return o->state;
 }




More information about the pulseaudio-commits mailing list