[pulseaudio-commits] r1631 - /branches/lennart/src/pulsecore/conf-parser.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Aug 11 08:57:22 PDT 2007


Author: lennart
Date: Sat Aug 11 17:57:21 2007
New Revision: 1631

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1631&root=3Dpulseaudio&vi=
ew=3Drev
Log:
modernization

Modified:
    branches/lennart/src/pulsecore/conf-parser.c

Modified: branches/lennart/src/pulsecore/conf-parser.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
conf-parser.c?rev=3D1631&root=3Dpulseaudio&r1=3D1630&r2=3D1631&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/conf-parser.c (original)
+++ branches/lennart/src/pulsecore/conf-parser.c Sat Aug 11 17:57:21 2007
@@ -25,7 +25,6 @@
 #include <config.h>
 #endif
 =

-#include <assert.h>
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
@@ -35,6 +34,7 @@
 #include <pulsecore/core-error.h>
 #include <pulsecore/log.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/macro.h>
 =

 #include "conf-parser.h"
 =

@@ -43,7 +43,10 @@
 =

 /* Run the user supplied parser for an assignment */
 static int next_assignment(const char *filename, unsigned line, const pa_c=
onfig_item *t, const char *lvalue, const char *rvalue, void *userdata) {
-    assert(filename && t && lvalue && rvalue);
+    pa_assert(filename);
+    pa_assert(t);
+    pa_assert(lvalue);
+    pa_assert(rvalue);
 =

     for (; t->parse; t++)
         if (!strcmp(lvalue, t->lvalue))
@@ -56,7 +59,7 @@
 =

 /* Returns non-zero when c is contained in s */
 static int in_string(char c, const char *s) {
-    assert(s);
+    pa_assert(s);
 =

     for (; *s; s++)
         if (*s =3D=3D c)
@@ -107,7 +110,9 @@
     int r =3D -1;
     unsigned line =3D 0;
     int do_close =3D !f;
-    assert(filename && t);
+    =

+    pa_assert(filename);
+    pa_assert(t);
 =

     if (!f && !(f =3D fopen(filename, "r"))) {
         if (errno =3D=3D ENOENT) {
@@ -148,7 +153,11 @@
 int pa_config_parse_int(const char *filename, unsigned line, const char *l=
value, const char *rvalue, void *data, PA_GCC_UNUSED void *userdata) {
     int *i =3D data;
     int32_t k;
-    assert(filename && lvalue && rvalue && data);
+    =

+    pa_assert(filename);
+    pa_assert(lvalue);
+    pa_assert(rvalue);
+    pa_assert(data);
 =

     if (pa_atoi(rvalue, &k) < 0) {
         pa_log("[%s:%u] Failed to parse numeric value: %s", filename, line=
, rvalue);
@@ -161,7 +170,11 @@
 =

 int pa_config_parse_bool(const char *filename, unsigned line, const char *=
lvalue, const char *rvalue, void *data, PA_GCC_UNUSED void *userdata) {
     int *b =3D data, k;
-    assert(filename && lvalue && rvalue && data);
+
+    pa_assert(filename);
+    pa_assert(lvalue);
+    pa_assert(rvalue);
+    pa_assert(data);
 =

     if ((k =3D pa_parse_boolean(rvalue)) < 0) {
         pa_log("[%s:%u] Failed to parse boolean value: %s", filename, line=
, rvalue);
@@ -175,7 +188,11 @@
 =

 int pa_config_parse_string(const char *filename, PA_GCC_UNUSED unsigned li=
ne, const char *lvalue, const char *rvalue, void *data, PA_GCC_UNUSED void =
*userdata) {
     char **s =3D data;
-    assert(filename && lvalue && rvalue && data);
+
+    pa_assert(filename);
+    pa_assert(lvalue);
+    pa_assert(rvalue);
+    pa_assert(data);
 =

     pa_xfree(*s);
     *s =3D *rvalue ? pa_xstrdup(rvalue) : NULL;




More information about the pulseaudio-commits mailing list