* remove a lot of compiler warnings introduced by using some new GCC flags

* add typedefs for public structs and enums and drop the struct/enum prefixs from all uses where it makes sense


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@447 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-01-11 01:17:39 +00:00
parent 6c512fb5a3
commit 1f0961368f
200 changed files with 3582 additions and 3468 deletions

View file

@ -25,17 +25,17 @@
#include "props.h"
#include "log.h"
struct pa_property {
typedef struct pa_property {
char *name; /* Points to memory allocated by the property subsystem */
void *data; /* Points to memory maintained by the caller */
};
} pa_property;
/* Allocate a new property object */
static struct pa_property* property_new(const char *name, void *data) {
struct pa_property* p;
static pa_property* property_new(const char *name, void *data) {
pa_property* p;
assert(name && data);
p = pa_xmalloc(sizeof(struct pa_property));
p = pa_xmalloc(sizeof(pa_property));
p->name = pa_xstrdup(name);
p->data = data;
@ -43,15 +43,15 @@ static struct pa_property* property_new(const char *name, void *data) {
}
/* Free a property object */
static void property_free(struct pa_property *p) {
static void property_free(pa_property *p) {
assert(p);
pa_xfree(p->name);
pa_xfree(p);
}
void* pa_property_get(struct pa_core *c, const char *name) {
struct pa_property *p;
void* pa_property_get(pa_core *c, const char *name) {
pa_property *p;
assert(c && name && c->properties);
if (!(p = pa_hashmap_get(c->properties, name)))
@ -60,8 +60,8 @@ void* pa_property_get(struct pa_core *c, const char *name) {
return p->data;
}
int pa_property_set(struct pa_core *c, const char *name, void *data) {
struct pa_property *p;
int pa_property_set(pa_core *c, const char *name, void *data) {
pa_property *p;
assert(c && name && data && c->properties);
if (pa_hashmap_get(c->properties, name))
@ -72,8 +72,8 @@ int pa_property_set(struct pa_core *c, const char *name, void *data) {
return 0;
}
int pa_property_remove(struct pa_core *c, const char *name) {
struct pa_property *p;
int pa_property_remove(pa_core *c, const char *name) {
pa_property *p;
assert(c && name && c->properties);
if (!(p = pa_hashmap_remove(c->properties, name)))
@ -83,35 +83,35 @@ int pa_property_remove(struct pa_core *c, const char *name) {
return 0;
}
void pa_property_init(struct pa_core *c) {
void pa_property_init(pa_core *c) {
assert(c);
c->properties = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
}
void pa_property_cleanup(struct pa_core *c) {
void pa_property_cleanup(pa_core *c) {
assert(c);
if (!c->properties)
return;
assert(!pa_hashmap_ncontents(c->properties));
assert(!pa_hashmap_size(c->properties));
pa_hashmap_free(c->properties, NULL, NULL);
c->properties = NULL;
}
void pa_property_dump(struct pa_core *c, struct pa_strbuf *s) {
void pa_property_dump(pa_core *c, pa_strbuf *s) {
void *state = NULL;
struct pa_property *p;
pa_property *p;
assert(c && s);
while ((p = pa_hashmap_iterate(c->properties, &state, NULL)))
pa_strbuf_printf(s, "[%s] -> [%p]\n", p->name, p->data);
}
int pa_property_replace(struct pa_core *c, const char *name, void *data) {
int pa_property_replace(pa_core *c, const char *name, void *data) {
assert(c && name);
pa_property_remove(c, name);