]> code.delx.au - pulseaudio/commitdiff
simple: use pa_xnew0 instead of manual reset to 0
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Aug 2009 23:04:08 +0000 (01:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 4 Aug 2009 23:04:08 +0000 (01:04 +0200)
src/pulse/simple.c

index bd11cb3763876eb455e63574258536326dd190b8..7fd7cce7db10ff0cac39c34fabf88355ec886423 100644 (file)
@@ -157,12 +157,8 @@ pa_simple* pa_simple_new(
     CHECK_VALIDITY_RETURN_ANY(rerror, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID, NULL);
     CHECK_VALIDITY_RETURN_ANY(rerror, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID, NULL)
 
-    p = pa_xnew(pa_simple, 1);
-    p->context = NULL;
-    p->stream = NULL;
+    p = pa_xnew0(pa_simple, 1);
     p->direction = dir;
-    p->read_data = NULL;
-    p->read_index = p->read_length = 0;
 
     if (!(p->mainloop = pa_threaded_mainloop_new()))
         goto fail;