ref: cbcbe8d9a2048e4826fa85f687a4181b1ffc6a32
parent: d1f2d06df8f18dfe848a10ef430e67ba9d398dc8
author: Matthew Chung <matthewchung74@gmail.com>
date: Fri Mar 8 05:49:41 EST 2013
Add casts to remove clang warnings. Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
--- a/src/info.c
+++ b/src/info.c
@@ -190,11 +190,11 @@
int *comment_lengths;
int ncomments;
ncomments=_tags->comments;
- user_comments=_ogg_realloc(_tags->user_comments,
+ user_comments=(char **)_ogg_realloc(_tags->user_comments,
sizeof(*_tags->user_comments)*(ncomments+2));
if(OP_UNLIKELY(user_comments==NULL))return OP_EFAULT;
_tags->user_comments=user_comments;
- comment_lengths=_ogg_realloc(_tags->comment_lengths,
+ comment_lengths=(int *)_ogg_realloc(_tags->comment_lengths,
sizeof(*_tags->comment_lengths)*(ncomments+2));
if(OP_UNLIKELY(comment_lengths==NULL))return OP_EFAULT;
_tags->comment_lengths=comment_lengths;
--- a/src/opusfile.c
+++ b/src/opusfile.c
@@ -236,7 +236,8 @@
if(OP_UNLIKELY(cserialnos>INT_MAX-1>>1))return OP_EFAULT;
cserialnos=2*cserialnos+1;
OP_ASSERT(nserialnos<cserialnos);
- serialnos=_ogg_realloc(serialnos,sizeof(*serialnos)*cserialnos);
+ serialnos=(ogg_uint32_t *)_ogg_realloc(serialnos,
+ sizeof(*serialnos)*cserialnos);
if(OP_UNLIKELY(serialnos==NULL))return OP_EFAULT;
}
serialnos[nserialnos++]=s;
@@ -1132,7 +1133,7 @@
if(OP_UNLIKELY(clinks>INT_MAX-1>>1))return OP_EFAULT;
clinks=2*clinks+1;
OP_ASSERT(nlinks<clinks);
- links=_ogg_realloc(links,sizeof(*links)*clinks);
+ links=(OggOpusLink *)_ogg_realloc(links,sizeof(*links)*clinks);
if(OP_UNLIKELY(links==NULL))return OP_EFAULT;
_of->links=links;
}
@@ -1281,7 +1282,7 @@
if(OP_UNLIKELY(ret<0))return ret;
}
/*Trim back the links array if necessary.*/
- links=_ogg_realloc(links,sizeof(*links)*nlinks);
+ links=(OggOpusLink *)_ogg_realloc(links,sizeof(*links)*nlinks);
if(OP_LIKELY(links!=NULL))_of->links=links;
/*We also don't need these anymore.*/
_ogg_free(*_serialnos);