Add casts to remove clang warnings.
authorMatthew Chung <matthewchung74@gmail.com>
Fri, 8 Mar 2013 18:49:41 +0000 (10:49 -0800)
committerTimothy B. Terriberry <tterribe@xiph.org>
Tue, 30 Apr 2013 15:37:07 +0000 (08:37 -0700)
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
src/info.c
src/opusfile.c

index 62edecd..195b56b 100644 (file)
@@ -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;
index 2e189f5..0a1b8d6 100644 (file)
@@ -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);