input_internal: add assertions

This commit is contained in:
Max Kellermann 2011-09-14 22:06:57 +02:00
parent dd33317f45
commit 8c6e8a6eb8

View File

@ -21,10 +21,16 @@
#include "input_internal.h" #include "input_internal.h"
#include "input_stream.h" #include "input_stream.h"
#include <assert.h>
void void
input_stream_init(struct input_stream *is, const struct input_plugin *plugin, input_stream_init(struct input_stream *is, const struct input_plugin *plugin,
const char *uri) const char *uri)
{ {
assert(is != NULL);
assert(plugin != NULL);
assert(uri != NULL);
is->plugin = plugin; is->plugin = plugin;
is->uri = g_strdup(uri); is->uri = g_strdup(uri);
is->ready = false; is->ready = false;
@ -37,6 +43,9 @@ input_stream_init(struct input_stream *is, const struct input_plugin *plugin,
void void
input_stream_deinit(struct input_stream *is) input_stream_deinit(struct input_stream *is)
{ {
assert(is != NULL);
assert(is->plugin != NULL);
g_free(is->uri); g_free(is->uri);
g_free(is->mime); g_free(is->mime);
} }