summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:30:41 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:32:46 +0100
commit88835840ea5a9aa75cf563de0042cf92db305dc9 (patch)
treeafda9863728d7edbfc4af56147e4c3daafdef661 /src/lib/ecore_audio
parente99ab4623a936e06758ae837fadd183d89d8c5d1 (diff)
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 <d.willmann@samsung.com>
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c7
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.h2
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_protected.h2
5 files changed, 9 insertions, 10 deletions
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)
146 ssize_t len_read = 0; 146 ssize_t len_read = 0;
147 const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 147 const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
148 148
149 char *buf = va_arg(*list, char *); 149 void *buf = va_arg(*list, void *);
150 size_t len = va_arg(*list, size_t); 150 size_t len = va_arg(*list, size_t);
151 ssize_t *ret = va_arg(*list, ssize_t *); 151 ssize_t *ret = va_arg(*list, ssize_t *);
152 152
@@ -171,13 +171,12 @@ static void _read(Eo *eo_obj, void *_pd, va_list *list)
171 *ret = len_read; 171 *ret = len_read;
172} 172}
173 173
174static void _read_internal(Eo *eo_obj, void *_pd, va_list *list) 174static void _read_internal(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
175{ 175{
176 const Ecore_Audio_Input *obj = _pd;
177 ssize_t len_read = 0; 176 ssize_t len_read = 0;
178 const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 177 const Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
179 178
180 char *buf = va_arg(*list, char *); 179 void *buf = va_arg(*list, void *);
181 size_t len = va_arg(*list, size_t); 180 size_t len = va_arg(*list, size_t);
182 ssize_t *ret = va_arg(*list, ssize_t *); 181 ssize_t *ret = va_arg(*list, ssize_t *);
183 182
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
104 104
105#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) 105#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)
106 106
107#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) 107#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)
108 108
109#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) 109#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)
110 110
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 = {
99 99
100/* End virtual IO wrapper functions */ 100/* End virtual IO wrapper functions */
101 101
102static void _read(Eo *eo_obj, void *_pd, va_list *list) 102static void _read(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
103{ 103{
104 Ecore_Audio_Sndfile *obj = _pd; 104 Ecore_Audio_Sndfile *obj = _pd;
105 int read; 105 int read;
106 void *data = va_arg(*list, void *); 106 void *data = va_arg(*list, void *);
107 int len = va_arg(*list, int); 107 size_t len = va_arg(*list, size_t);
108 int *ret = va_arg(*list, int *); 108 ssize_t *ret = va_arg(*list, ssize_t *);
109 109
110 read = sf_read_float(obj->handle, data, len/4)*4; 110 read = sf_read_float(obj->handle, data, len/4)*4;
111 111
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)
37 Ecore_Audio_Sndfile *obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS); 37 Ecore_Audio_Sndfile *obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS);
38 Ecore_Audio_Output *out_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS); 38 Ecore_Audio_Output *out_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS);
39 39
40 int written, bread; 40 ssize_t written, bread;
41 float buf[1024]; 41 float buf[1024];
42 42
43 /* TODO: Support mixing of multiple inputs */ 43 /* 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 @@
5#include "Ecore.h" 5#include "Ecore.h"
6#include "Ecore_Audio.h" 6#include "Ecore_Audio.h"
7 7
8#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) 8#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)
9 9
10#endif 10#endif