Commit cbcbe8d9 authored by Matthew Chung's avatar Matthew Chung Committed by Timothy B. Terriberry

Add casts to remove clang warnings.

Signed-off-by: Timothy B. Terriberry's avatarTimothy B. Terriberry <tterribe@xiph.org>
parent d1f2d06d
......@@ -190,11 +190,11 @@ static int op_tags_add_prepare(OpusTags *_tags){
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;
......
......@@ -236,7 +236,8 @@ static int op_add_serialno(ogg_page *_og,
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 @@ static int op_bisect_forward_serialno(OggOpusFile *_of,
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 @@ static int op_bisect_forward_serialno(OggOpusFile *_of,
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment