shithub: sox

Download patch

ref: 1d88da48f100386767b2f4ecafc9e59798932873
parent: ae4743adcd38f1099b09f5bb856c8fd99418635f
author: Rob Sykes <robs@users.sourceforge.net>
date: Wed Feb 27 16:58:50 EST 2013

fix warnings

--- a/src/mp3-util.h
+++ b/src/mp3-util.h
@@ -143,14 +143,14 @@
     }
   }
 
-  buffer = lsx_malloc(size);
+  buffer = lsx_malloc((size_t)size);
   if (!buffer) {
     return 0;
   }
   memcpy(buffer, query, ID3_TAG_QUERYSIZE);
   if ((unsigned long)size - ID3_TAG_QUERYSIZE ==
-      lsx_readbuf(info->ft, buffer + ID3_TAG_QUERYSIZE, size - ID3_TAG_QUERYSIZE)) {
-    struct id3_tag * tag = id3_tag_parse(buffer, size);
+      lsx_readbuf(info->ft, buffer + ID3_TAG_QUERYSIZE, (size_t)size - ID3_TAG_QUERYSIZE)) {
+    struct id3_tag * tag = id3_tag_parse(buffer, (size_t)size);
     if (tag) {
       current = lsx_malloc(sizeof(struct tag_info_node));
       if (current) {
@@ -161,7 +161,7 @@
         if (info->tag && (info->tag->extendedflags & ID3_TAG_EXTENDEDFLAG_TAGISANUPDATE)) {
           struct id3_frame * frame;
           unsigned i;
-          for (i = 0; frame = id3_tag_findframe(tag, NULL, i); i++) {
+          for (i = 0; (frame = id3_tag_findframe(tag, NULL, i)); i++) {
             id3_tag_attachframe(info->tag, frame);
           }
           id3_tag_delete(tag);