summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mkv.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-30 07:27:43 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-30 07:27:43 +0000
commitd1b5f6efa12de667a9a64233b4c3a3456a577fc5 (patch)
tree3e6e42b649f3fb0990bc9d36e3da3851150e0f50 /libmpdemux/demux_mkv.c
parent6fa7e2d8670efd6b157d230fd528df32df213785 (diff)
downloadmpv-d1b5f6efa12de667a9a64233b4c3a3456a577fc5.tar.bz2
mpv-d1b5f6efa12de667a9a64233b4c3a3456a577fc5.tar.xz
Change grow_array argument from void ** to void *, this avoids a aliasing
violation (thus making gcc 4.4.x compile the code correctly) and allows to get rid of some casts at the expense of making the code less clear. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29733 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_mkv.c')
-rw-r--r--libmpdemux/demux_mkv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index 627ac7cd44..3163f9b658 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -204,11 +204,12 @@ extern int dvdsub_id;
/**
* \brief ensures there is space for at least one additional element
- * \param array array to grow
+ * \param arrayp array to grow
* \param nelem current number of elements in array
* \param elsize size of one array element
*/
-static void grow_array(void **array, int nelem, size_t elsize) {
+static void grow_array(void *arrayp, int nelem, size_t elsize) {
+ void **array = arrayp;
if (!(nelem & 31))
*array = realloc(*array, (nelem + 32) * elsize);
}
@@ -235,7 +236,7 @@ add_cluster_position (mkv_demuxer_t *mkv_d, uint64_t position)
if (mkv_d->cluster_positions[i] == position)
return;
- grow_array((void **)&mkv_d->cluster_positions, mkv_d->num_cluster_pos,
+ grow_array(&mkv_d->cluster_positions, mkv_d->num_cluster_pos,
sizeof(uint64_t));
mkv_d->cluster_positions[mkv_d->num_cluster_pos++] = position;
}
@@ -1079,7 +1080,7 @@ demux_mkv_read_cues (demuxer_t *demuxer)
if (time != EBML_UINT_INVALID && track != EBML_UINT_INVALID
&& pos != EBML_UINT_INVALID)
{
- grow_array((void **)&mkv_d->indexes, mkv_d->num_indexes, sizeof(mkv_index_t));
+ grow_array(&mkv_d->indexes, mkv_d->num_indexes, sizeof(mkv_index_t));
mkv_d->indexes[mkv_d->num_indexes].tnum = track;
mkv_d->indexes[mkv_d->num_indexes].timecode = time;
mkv_d->indexes[mkv_d->num_indexes].filepos =mkv_d->segment_start+pos;