[MPlayer-dev-eng] [PATCH] more make warnings

timwoj at ieee.org timwoj at ieee.org
Fri Jun 1 04:31:55 CEST 2007


Here's fixes for most of the make warnings from the -Wall build I did the 
other day.  It's mostly fixes for printf-style formats that were 
passed to mp_msg, but there's a few other things in there as well.

Tim
-------------- next part --------------
Index: libmpcodecs/vd_qtvideo.c
===================================================================
--- libmpcodecs/vd_qtvideo.c	(revision 23440)
+++ libmpcodecs/vd_qtvideo.c	(working copy)
@@ -204,7 +204,7 @@
 
     memset(&icap,0,sizeof(icap));
     cres=ImageCodecInitialize(ci,&icap);
-    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecInitialize->%#x  size=%d (%d)\n",cres,icap.recordSize,icap.decompressRecordSize);
+    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecInitialize->%#x  size=%ld (%ld)\n",cres,icap.recordSize,icap.decompressRecordSize);
     
     memset(&cinfo,0,sizeof(cinfo));
     cres=ImageCodecGetCodecInfo(ci,&cinfo);
Index: libmpcodecs/ad_hwmpa.c
===================================================================
--- libmpcodecs/ad_hwmpa.c	(revision 23440)
+++ libmpcodecs/ad_hwmpa.c	(working copy)
@@ -28,7 +28,7 @@
 
 static int mpa_sync(sh_audio_t *sh, int no_frames, int *n, int *chans, int *srate, int *spf, int *mpa_layer, int *br)
 {
-	int cnt = 0, x = 0, len, frames_count;
+	int cnt = 0, x = 0, len = 0, frames_count;
 
 	frames_count = 0;
 	do
@@ -122,7 +122,7 @@
 
 static int control(sh_audio_t *sh,int cmd,void* arg, ...)
 {
-	int start, len;
+	int start, len = 0;
 
 	switch(cmd)
 	{
Index: libfaad2/specrec.c
===================================================================
--- libfaad2/specrec.c	(revision 23440)
+++ libfaad2/specrec.c	(working copy)
@@ -409,7 +409,7 @@
     }
 }
 
-/* iquant() *
+/* iquant() */
 /* output = sign(input)*abs(input)^(4/3) */
 /**/
 static INLINE real_t iquant(int16_t q, const real_t *tab, uint8_t *error)
Index: playtreeparser.c
===================================================================
--- playtreeparser.c	(revision 23440)
+++ playtreeparser.c	(working copy)
@@ -520,7 +520,7 @@
     pos = line;
    while (pos) {
     if (!entrymode) { // all entries filled so far 
-     while (pos=strchr(pos, '<')) {
+     while ((pos=strchr(pos, '<')) != 0) {
       if (strncasecmp(pos,"<video",6)==0  || strncasecmp(pos,"<audio",6)==0 || strncasecmp(pos,"<media",6)==0) {
           entrymode=1;
           break; // Got a valid tag, exit '<' search loop
Index: playtree.c
===================================================================
--- playtree.c	(revision 23440)
+++ playtree.c	(working copy)
@@ -22,7 +22,7 @@
 play_tree_new(void) {
   play_tree_t* r = calloc(1,sizeof(play_tree_t));
   if(r == NULL)
-    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",sizeof(play_tree_t));
+    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",sizeof(play_tree_t));
   r->entry_type = PLAY_TREE_ENTRY_NODE;
   return r;
 }
@@ -266,7 +266,7 @@
   }
   pt->files = (char**)realloc(pt->files,(n+2)*sizeof(char*));
   if(pt->files ==NULL) {
-    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",(n+2)*sizeof(char*));
+    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",(n+2)*sizeof(char*));
     return;
   }
 
@@ -305,7 +305,7 @@
     memmove(&pt->files[f],&pt->files[f+1],(n-f)*sizeof(char*));
     pt->files = (char**)realloc(pt->files,n*sizeof(char*));
     if(pt->files == NULL) {
-      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",(n+2)*sizeof(char*));
+      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",(n+2)*sizeof(char*));
       return -1;
     }
   } else {
@@ -340,7 +340,7 @@
 
   pt->params = (play_tree_param_t*)realloc(pt->params,(n+2)*sizeof(play_tree_param_t));
   if(pt->params == NULL) {
-      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't realloc params (%d bytes of memory)\n",(n+2)*sizeof(play_tree_param_t));
+      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't realloc params (%ld bytes of memory)\n",(n+2)*sizeof(play_tree_param_t));
       return;
   }
   pt->params[n].name = strdup(name);
@@ -375,7 +375,7 @@
     memmove(&pt->params[ni],&pt->params[ni+1],(n-ni)*sizeof(play_tree_param_t));
     pt->params = (play_tree_param_t*)realloc(pt->params,n*sizeof(play_tree_param_t));
     if(pt->params == NULL) {
-      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",n*sizeof(play_tree_param_t));
+      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",n*sizeof(play_tree_param_t));
       return -1;
     }
   } else {
@@ -482,7 +482,7 @@
 
   iter = calloc(1,sizeof(play_tree_iter_t));
   if(! iter) {
-      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate new iterator (%d bytes of memory)\n",sizeof(play_tree_iter_t));
+      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate new iterator (%ld bytes of memory)\n",sizeof(play_tree_iter_t));
       return NULL;
   }
   iter->root = pt;
@@ -704,7 +704,7 @@
     iter->status_stack = NULL;
   }
   if(iter->stack_size > 0 && iter->status_stack == NULL) {
-    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",iter->stack_size*sizeof(char*));
+    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",iter->stack_size*sizeof(char*));
     return PLAY_TREE_ITER_ERROR;
   }
   iter->tree = iter->tree->parent;
@@ -738,7 +738,7 @@
   iter->stack_size++;
   iter->status_stack = (int*)realloc(iter->status_stack,iter->stack_size*sizeof(int));
   if(iter->status_stack == NULL) {
-    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",iter->stack_size*sizeof(int));
+    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",iter->stack_size*sizeof(int));
     return PLAY_TREE_ITER_ERROR;
   }
   iter->status_stack[iter->stack_size-1] = iter->loop;
@@ -831,7 +831,7 @@
 
   iter = malloc(sizeof(play_tree_iter_t));
   if(iter == NULL) {
-    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",sizeof(play_tree_iter_t));
+    mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",sizeof(play_tree_iter_t));
     return NULL;
   }
 ;
@@ -839,7 +839,7 @@
   if(old->status_stack) {
     iter->status_stack = malloc(old->stack_size * sizeof(int));
     if(iter->status_stack == NULL) {
-      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %d bytes of memory\n",old->stack_size * sizeof(int));
+      mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Can't allocate %ld bytes of memory\n",old->stack_size * sizeof(int));
       free(iter);
       return NULL;
     }


More information about the MPlayer-dev-eng mailing list