[pulseaudio-commits] 2 commits - src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Tue Jun 25 09:29:29 PDT 2013
src/pulsecore/device-port.c | 1 +
src/pulsecore/object.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit c005ec79f7dcf2bf95c4861106789678d6a3c951
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Wed Jun 19 18:40:17 2013 +0300
object: Initialize allocated memory to zero
This is safer and more convenient for subclasses.
diff --git a/src/pulsecore/object.c b/src/pulsecore/object.c
index 0dc8198..b6fbe90 100644
--- a/src/pulsecore/object.c
+++ b/src/pulsecore/object.c
@@ -40,7 +40,7 @@ pa_object *pa_object_new_internal(size_t size, const char *type_id, pa_bool_t (*
pa_assert(check_type(type_id));
pa_assert(check_type(pa_object_type_id));
- o = pa_xmalloc(size);
+ o = pa_xmalloc0(size);
PA_REFCNT_INIT(o);
o->type_id = type_id;
o->free = pa_object_free;
commit a9c3503ee908250d45b20a0df63d445b18476c17
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Wed Jun 19 18:39:58 2013 +0300
device-port: Assert that ports have a description
It's easier to work with the port description if it can be assumed
that it's always non-NULL. I have checked that the current code base
always ensures a non-NULL description.
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
index 57d0293..8bff5b6 100644
--- a/src/pulsecore/device-port.c
+++ b/src/pulsecore/device-port.c
@@ -110,6 +110,7 @@ pa_device_port *pa_device_port_new(pa_core *c, pa_device_port_new_data *data, si
pa_assert(data);
pa_assert(data->name);
+ pa_assert(data->description);
pa_assert(data->direction == PA_DIRECTION_OUTPUT || data->direction == PA_DIRECTION_INPUT);
p = PA_DEVICE_PORT(pa_object_new_internal(PA_ALIGN(sizeof(pa_device_port)) + extra, pa_device_port_type_id, pa_device_port_check_type));
More information about the pulseaudio-commits
mailing list