From: Daniel Willmann Date: Thu, 18 Apr 2013 18:30:41 +0000 (+0100) Subject: ecore_audio: Change method signature of read and read_internal X-Git-Tag: submit/efl/20131015.063327~1234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88835840ea5a9aa75cf563de0042cf92db305dc9;p=platform%2Fupstream%2Fefl.git ecore_audio: Change method signature of read and read_internal Use size_t and ssize_t as len/return value Signed-off-by: Daniel Willmann --- diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c index 1528a04fa0..292d06c8e6 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in.c @@ -146,7 +146,7 @@ static void _read(Eo *eo_obj, void *_pd, va_list *list) ssize_t len_read = 0; const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); - char *buf = va_arg(*list, char *); + void *buf = va_arg(*list, void *); size_t len = va_arg(*list, size_t); ssize_t *ret = va_arg(*list, ssize_t *); @@ -171,13 +171,12 @@ static void _read(Eo *eo_obj, void *_pd, va_list *list) *ret = len_read; } -static void _read_internal(Eo *eo_obj, void *_pd, va_list *list) +static void _read_internal(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) { - const Ecore_Audio_Input *obj = _pd; ssize_t len_read = 0; const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); - char *buf = va_arg(*list, char *); + void *buf = va_arg(*list, void *); size_t len = va_arg(*list, size_t); ssize_t *ret = va_arg(*list, ssize_t *); diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.h b/src/lib/ecore_audio/ecore_audio_obj_in.h index 9d88df51fe..1a7d702982 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.h +++ b/src/lib/ecore_audio/ecore_audio_obj_in.h @@ -104,7 +104,7 @@ enum Ecore_Audio_Obj_In_Sub_Ids #define ecore_audio_obj_in_length_get(ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_LENGTH_GET), EO_TYPECHECK(double *, ret) -#define ecore_audio_obj_in_read(buf, len, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ), EO_TYPECHECK(char *, buf), EO_TYPECHECK(size_t, len), EO_TYPECHECK(ssize_t *, ret) +#define ecore_audio_obj_in_read(buf, len, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ), EO_TYPECHECK(void *, buf), EO_TYPECHECK(size_t, len), EO_TYPECHECK(ssize_t *, ret) #define ecore_audio_obj_in_seek(offs, mode, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_SEEK), EO_TYPECHECK(double, offs), EO_TYPECHECK(int, mode), EO_TYPECHECK(double *, ret) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c index 92d7f10a89..42df376abd 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c @@ -99,13 +99,13 @@ static SF_VIRTUAL_IO vio_wrapper = { /* End virtual IO wrapper functions */ -static void _read(Eo *eo_obj, void *_pd, va_list *list) +static void _read(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) { Ecore_Audio_Sndfile *obj = _pd; int read; void *data = va_arg(*list, void *); - int len = va_arg(*list, int); - int *ret = va_arg(*list, int *); + size_t len = va_arg(*list, size_t); + ssize_t *ret = va_arg(*list, ssize_t *); read = sf_read_float(obj->handle, data, len/4)*4; diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c index db0ca4b19f..4a04f2aa5a 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c +++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c @@ -37,7 +37,7 @@ static Eina_Bool _write_cb(void *data) Ecore_Audio_Sndfile *obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS); Ecore_Audio_Output *out_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS); - int written, bread; + ssize_t written, bread; float buf[1024]; /* TODO: Support mixing of multiple inputs */ diff --git a/src/lib/ecore_audio/ecore_audio_protected.h b/src/lib/ecore_audio/ecore_audio_protected.h index 0e962cea17..7dc835c9ae 100644 --- a/src/lib/ecore_audio/ecore_audio_protected.h +++ b/src/lib/ecore_audio/ecore_audio_protected.h @@ -5,6 +5,6 @@ #include "Ecore.h" #include "Ecore_Audio.h" -#define ecore_audio_obj_in_read_internal(buf, len, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ_INTERNAL), EO_TYPECHECK(char *, buf), EO_TYPECHECK(int, len), EO_TYPECHECK(int *, ret) +#define ecore_audio_obj_in_read_internal(buf, len, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ_INTERNAL), EO_TYPECHECK(void *, buf), EO_TYPECHECK(size_t, len), EO_TYPECHECK(ssize_t *, ret) #endif