Remove assert from header files

Putting assert in the public macros isn't good idea at all.
Let's get rid of them.

Also, clean up snd*_alloca() functions to use a helper macro
instead of copy and paste.
This commit is contained in:
Takashi Iwai 2007-10-25 15:36:03 +02:00
parent 9eb272c753
commit 68e5771a6f
11 changed files with 43 additions and 53 deletions

View file

@ -164,7 +164,7 @@ ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size);
size_t snd_timer_id_sizeof(void);
/** allocate #snd_timer_id_t container on stack */
#define snd_timer_id_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_id_t *) alloca(snd_timer_id_sizeof()); memset(*ptr, 0, snd_timer_id_sizeof()); } while (0)
#define snd_timer_id_alloca(ptr) __snd_alloca(ptr, snd_timer_id)
int snd_timer_id_malloc(snd_timer_id_t **ptr);
void snd_timer_id_free(snd_timer_id_t *obj);
void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src);
@ -182,7 +182,7 @@ int snd_timer_id_get_subdevice(snd_timer_id_t *id);
size_t snd_timer_ginfo_sizeof(void);
/** allocate #snd_timer_ginfo_t container on stack */
#define snd_timer_ginfo_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_ginfo_t *) alloca(snd_timer_ginfo_sizeof()); memset(*ptr, 0, snd_timer_ginfo_sizeof()); } while (0)
#define snd_timer_ginfo_alloca(ptr) __snd_alloca(ptr, snd_timer_ginfo)
int snd_timer_ginfo_malloc(snd_timer_ginfo_t **ptr);
void snd_timer_ginfo_free(snd_timer_ginfo_t *obj);
void snd_timer_ginfo_copy(snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src);
@ -200,7 +200,7 @@ unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t *obj);
size_t snd_timer_info_sizeof(void);
/** allocate #snd_timer_info_t container on stack */
#define snd_timer_info_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_info_t *) alloca(snd_timer_info_sizeof()); memset(*ptr, 0, snd_timer_info_sizeof()); } while (0)
#define snd_timer_info_alloca(ptr) __snd_alloca(ptr, snd_timer_info)
int snd_timer_info_malloc(snd_timer_info_t **ptr);
void snd_timer_info_free(snd_timer_info_t *obj);
void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src);
@ -213,7 +213,7 @@ long snd_timer_info_get_resolution(snd_timer_info_t * info);
size_t snd_timer_params_sizeof(void);
/** allocate #snd_timer_params_t container on stack */
#define snd_timer_params_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_params_t *) alloca(snd_timer_params_sizeof()); memset(*ptr, 0, snd_timer_params_sizeof()); } while (0)
#define snd_timer_params_alloca(ptr) __snd_alloca(ptr, snd_timer_params)
int snd_timer_params_malloc(snd_timer_params_t **ptr);
void snd_timer_params_free(snd_timer_params_t *obj);
void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src);
@ -233,7 +233,7 @@ unsigned int snd_timer_params_get_filter(snd_timer_params_t * params);
size_t snd_timer_status_sizeof(void);
/** allocate #snd_timer_status_t container on stack */
#define snd_timer_status_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_status_t *) alloca(snd_timer_status_sizeof()); memset(*ptr, 0, snd_timer_status_sizeof()); } while (0)
#define snd_timer_status_alloca(ptr) __snd_alloca(ptr, snd_timer_status)
int snd_timer_status_malloc(snd_timer_status_t **ptr);
void snd_timer_status_free(snd_timer_status_t *obj);
void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src);