summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-16 15:12:23 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-16 15:12:23 +0000
commit26230ae04859f277a6d6ee0d7e603c0788ca7136 (patch)
tree868a32442462145fce9cd92b46e51e3ddad78d72
parent53a858b36c7c31e72ad28ae06721258ea4cdd039 (diff)
MPEGPlayer: reconceal the point puns
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26090 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/mpegplayer/disk_buf.c8
-rw-r--r--apps/plugins/mpegplayer/disk_buf.h15
-rw-r--r--apps/plugins/mpegplayer/mpeg_parser.c10
3 files changed, 20 insertions, 13 deletions
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c
index 39563b7041..2e40bb7ce9 100644
--- a/apps/plugins/mpegplayer/disk_buf.c
+++ b/apps/plugins/mpegplayer/disk_buf.c
@@ -610,8 +610,8 @@ static ssize_t disk_buf_probe(off_t start, size_t length, void **p)
/* Attempt to get a pointer to size bytes on the buffer. Returns real amount of
* data available as well as the size of non-wrapped data after *p. */
-ssize_t disk_buf_getbuffer(size_t size, void **pp, void **pwrap,
- size_t *sizewrap)
+ssize_t _disk_buf_getbuffer(size_t size, void **pp, void **pwrap,
+ size_t *sizewrap)
{
disk_buf_lock();
@@ -640,8 +640,8 @@ ssize_t disk_buf_getbuffer(size_t size, void **pp, void **pwrap,
return size;
}
-ssize_t disk_buf_getbuffer_l2(struct dbuf_l2_cache *l2,
- size_t size, void **pp)
+ssize_t _disk_buf_getbuffer_l2(struct dbuf_l2_cache *l2,
+ size_t size, void **pp)
{
off_t offs;
off_t l2_addr;
diff --git a/apps/plugins/mpegplayer/disk_buf.h b/apps/plugins/mpegplayer/disk_buf.h
index a5a10cfe69..ec02e64c86 100644
--- a/apps/plugins/mpegplayer/disk_buf.h
+++ b/apps/plugins/mpegplayer/disk_buf.h
@@ -116,10 +116,17 @@ static inline int disk_buf_status(void)
int disk_buf_open(const char *filename);
void disk_buf_close(void);
-ssize_t disk_buf_getbuffer(size_t size, void **pp, void **pwrap,
- size_t *sizewrap);
-ssize_t disk_buf_getbuffer_l2(struct dbuf_l2_cache *l2,
- size_t size, void **pp);
+ssize_t _disk_buf_getbuffer(size_t size, void **pp, void **pwrap,
+ size_t *sizewrap);
+#define disk_buf_getbuffer(size, pp, pwrap, sizewrap) \
+ _disk_buf_getbuffer((size), PUN_PTR(void **, (pp)), \
+ PUN_PTR(void **, (pwrap)), (sizewrap))
+
+ssize_t _disk_buf_getbuffer_l2(struct dbuf_l2_cache *l2,
+ size_t size, void **pp);
+#define disk_buf_getbuffer_l2(l2, size, pp) \
+ _disk_buf_getbuffer_l2((l2), (size), PUN_PTR(void **, (pp)))
+
ssize_t disk_buf_read(void *buffer, size_t size);
ssize_t disk_buf_lseek(off_t offset, int whence);
diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c
index f21292abd5..06fa01c2e9 100644
--- a/apps/plugins/mpegplayer/mpeg_parser.c
+++ b/apps/plugins/mpegplayer/mpeg_parser.c
@@ -99,7 +99,7 @@ uint8_t * mpeg_parser_scan_start_code(struct stream_scan *sk, uint32_t code)
{
uint8_t *p;
off_t pos = disk_buf_lseek(sk->pos, SEEK_SET);
- ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 4, (void **)&p);
+ ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 4, &p);
if (pos < 0 || len < 4)
break;
@@ -131,7 +131,7 @@ unsigned mpeg_parser_scan_pes(struct stream_scan *sk)
{
uint8_t *p;
off_t pos = disk_buf_lseek(sk->pos, SEEK_SET);
- ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 4, (void **)&p);
+ ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 4, &p);
if (pos < 0 || len < 4)
break;
@@ -192,7 +192,7 @@ uint32_t mpeg_parser_scan_pts(struct stream_scan *sk, unsigned id)
{
uint8_t *p;
off_t pos = disk_buf_lseek(sk->pos, SEEK_SET);
- ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 30, (void **)&p);
+ ssize_t len = disk_buf_getbuffer_l2(&sk->l2, 30, &p);
if (pos < 0 || len < 4)
break;
@@ -742,7 +742,7 @@ static int parse_demux(struct stream *str, enum stream_parse_mode type)
str->hdr.pos = disk_buf_lseek(str->hdr.pos, SEEK_SET);
if (str->hdr.pos < 0 || str->hdr.pos >= str->hdr.limit ||
- disk_buf_getbuffer(MIN_BUFAHEAD, (void **)&p, NULL, NULL) <= 0)
+ disk_buf_getbuffer(MIN_BUFAHEAD, &p, NULL, NULL) <= 0)
{
str_end_of_stream(str);
return STREAM_DATA_END;
@@ -1017,7 +1017,7 @@ static int parse_elementary(struct stream *str, enum stream_parse_mode type)
case STREAM_PM_RANDOM_ACCESS:
str->hdr.pos = disk_buf_lseek(str->hdr.pos, SEEK_SET);
- len = disk_buf_getbuffer(DISK_BUF_PAGE_SIZE, (void **)&p, NULL, NULL);
+ len = disk_buf_getbuffer(DISK_BUF_PAGE_SIZE, &p, NULL, NULL);
if (len <= 0 || str->hdr.pos < 0 || str->hdr.pos >= str->hdr.limit)
{