diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-11-26 01:51:09 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-11-26 01:51:09 -0500 |
commit | 3d72119dd462a82e7c253430a3ef8d1f104cdce2 (patch) | |
tree | 5b0a7ef62ffa7259cdbc0042d29d087a7567ff82 | |
parent | 9ed486bdc747b505a5b7b868c363dcff3e718a0d (diff) | |
download | rockbox-3d72119dd462a82e7c253430a3ef8d1f104cdce2.tar.gz rockbox-3d72119dd462a82e7c253430a3ef8d1f104cdce2.zip |
mpegplayer fix warnings
this should fix 'warning: cast between incompatible function types'
Change-Id: I7d192b8953fd14511431cb50254900f566eb0574
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.c | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_misc.c | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_misc.h | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.c | 14 |
4 files changed, 13 insertions, 11 deletions
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index b78407b9db..50c4222192 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c | |||
@@ -108,7 +108,7 @@ static int disk_buf_on_data_notify(struct stream_hdr *sh) | |||
108 | return DISK_BUF_NOTIFY_ERROR; | 108 | return DISK_BUF_NOTIFY_ERROR; |
109 | } | 109 | } |
110 | 110 | ||
111 | static bool check_data_notifies_callback(struct stream_hdr *sh, intptr_t data) | 111 | static bool check_data_notifies_callback(struct stream_hdr *sh, void *data) |
112 | { | 112 | { |
113 | if (disk_buf_is_data_ready(sh, 0)) | 113 | if (disk_buf_is_data_ready(sh, 0)) |
114 | { | 114 | { |
@@ -130,7 +130,7 @@ static inline void check_data_notifies(void) | |||
130 | { | 130 | { |
131 | list_enum_items(nf_list, | 131 | list_enum_items(nf_list, |
132 | (list_enum_callback_t)check_data_notifies_callback, | 132 | (list_enum_callback_t)check_data_notifies_callback, |
133 | 0); | 133 | NULL); |
134 | } | 134 | } |
135 | 135 | ||
136 | /* Clear all registered notifications - do not post them */ | 136 | /* Clear all registered notifications - do not post them */ |
diff --git a/apps/plugins/mpegplayer/mpeg_misc.c b/apps/plugins/mpegplayer/mpeg_misc.c index fc7fb87fd6..7b73c7c376 100644 --- a/apps/plugins/mpegplayer/mpeg_misc.c +++ b/apps/plugins/mpegplayer/mpeg_misc.c | |||
@@ -146,7 +146,7 @@ void list_clear_all(void **list) | |||
146 | * may return 'false' to stop the enumeration early. */ | 146 | * may return 'false' to stop the enumeration early. */ |
147 | void list_enum_items(void **list, | 147 | void list_enum_items(void **list, |
148 | list_enum_callback_t callback, | 148 | list_enum_callback_t callback, |
149 | intptr_t data) | 149 | void* data) |
150 | { | 150 | { |
151 | for (;;) | 151 | for (;;) |
152 | { | 152 | { |
diff --git a/apps/plugins/mpegplayer/mpeg_misc.h b/apps/plugins/mpegplayer/mpeg_misc.h index 6996f27987..6626bba594 100644 --- a/apps/plugins/mpegplayer/mpeg_misc.h +++ b/apps/plugins/mpegplayer/mpeg_misc.h | |||
@@ -222,11 +222,11 @@ void list_add_item(void **list, void *item); | |||
222 | void list_clear_all(void **list); | 222 | void list_clear_all(void **list); |
223 | 223 | ||
224 | /* Enumerate all items in the array. */ | 224 | /* Enumerate all items in the array. */ |
225 | typedef bool (*list_enum_callback_t)(void *item, intptr_t data); | 225 | typedef bool (*list_enum_callback_t)(void *item, void* data); |
226 | 226 | ||
227 | void list_enum_items(void **list, | 227 | void list_enum_items(void **list, |
228 | list_enum_callback_t callback, | 228 | list_enum_callback_t callback, |
229 | intptr_t data); | 229 | void *data); |
230 | 230 | ||
231 | 231 | ||
232 | /** System events **/ | 232 | /** System events **/ |
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c index 7c862d58fb..3cac8c0f57 100644 --- a/apps/plugins/mpegplayer/stream_mgr.c +++ b/apps/plugins/mpegplayer/stream_mgr.c | |||
@@ -155,13 +155,13 @@ void stream_add_stream(struct stream *str) | |||
155 | } | 155 | } |
156 | 156 | ||
157 | /* Callback for various list-moving operations */ | 157 | /* Callback for various list-moving operations */ |
158 | static bool strl_enum_callback(struct stream *str, intptr_t data) | 158 | static bool strl_enum_callback(struct stream *str, void *data) |
159 | { | 159 | { |
160 | actl_lock(); | 160 | actl_lock(); |
161 | 161 | ||
162 | list_remove_item(stream_mgr.strl, str); | 162 | list_remove_item(stream_mgr.strl, str); |
163 | 163 | ||
164 | if (data == 1) | 164 | if (*(int*)data == 1) |
165 | list_add_item(stream_mgr.actl, str); | 165 | list_add_item(stream_mgr.actl, str); |
166 | 166 | ||
167 | actl_unlock(); | 167 | actl_unlock(); |
@@ -172,15 +172,17 @@ static bool strl_enum_callback(struct stream *str, intptr_t data) | |||
172 | /* Clear all streams from active and playback pools */ | 172 | /* Clear all streams from active and playback pools */ |
173 | void stream_remove_streams(void) | 173 | void stream_remove_streams(void) |
174 | { | 174 | { |
175 | int add_item = 0; | ||
175 | list_enum_items(stream_mgr.strl, | 176 | list_enum_items(stream_mgr.strl, |
176 | (list_enum_callback_t)strl_enum_callback, 0); | 177 | (list_enum_callback_t)strl_enum_callback, (void *)&add_item); |
177 | } | 178 | } |
178 | 179 | ||
179 | /* Move the playback pool to the active list */ | 180 | /* Move the playback pool to the active list */ |
180 | void move_strl_to_actl(void) | 181 | void move_strl_to_actl(void) |
181 | { | 182 | { |
183 | int add_item = 1; | ||
182 | list_enum_items(stream_mgr.strl, | 184 | list_enum_items(stream_mgr.strl, |
183 | (list_enum_callback_t)strl_enum_callback, 1); | 185 | (list_enum_callback_t)strl_enum_callback, (void *)&add_item); |
184 | } | 186 | } |
185 | 187 | ||
186 | /* Remove a stream from the active list and return it to the pool */ | 188 | /* Remove a stream from the active list and return it to the pool */ |
@@ -238,7 +240,7 @@ static void actl_stream_broadcast(int cmd, intptr_t data) | |||
238 | sbd.data = data; | 240 | sbd.data = data; |
239 | list_enum_items(stream_mgr.actl, | 241 | list_enum_items(stream_mgr.actl, |
240 | (list_enum_callback_t)actl_stream_broadcast_callback, | 242 | (list_enum_callback_t)actl_stream_broadcast_callback, |
241 | (intptr_t)&sbd); | 243 | (void*)&sbd); |
242 | } | 244 | } |
243 | 245 | ||
244 | /* Set the current base clock */ | 246 | /* Set the current base clock */ |
@@ -923,7 +925,7 @@ bool stream_get_window(struct stream_window *sw) | |||
923 | actl_lock(); | 925 | actl_lock(); |
924 | list_enum_items(stream_mgr.actl, | 926 | list_enum_items(stream_mgr.actl, |
925 | (list_enum_callback_t)stream_get_window_callback, | 927 | (list_enum_callback_t)stream_get_window_callback, |
926 | (intptr_t)sw); | 928 | (void*)sw); |
927 | actl_unlock(); | 929 | actl_unlock(); |
928 | 930 | ||
929 | return sw->left <= sw->right; | 931 | return sw->left <= sw->right; |