changeset 23614:bab9e6c606cc

Cast sizeof() to int in mp_msg arguments so it fits the format string on 64bit
author reimar
date Sun, 24 Jun 2007 10:39:04 +0000
parents 990bafe740df
children 0999b3eb3ed4
files playtree.c
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/playtree.c	Sun Jun 24 10:26:01 2007 +0000
+++ b/playtree.c	Sun Jun 24 10:39:04 2007 +0000
@@ -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 %d bytes of memory\n",(int)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 %d bytes of memory\n",(n+2)*(int)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 %d bytes of memory\n",(n+2)*(int)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 (%d bytes of memory)\n",(n+2)*(int)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 %d bytes of memory\n",n*(int)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 (%d bytes of memory)\n",(int)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 %d bytes of memory\n",iter->stack_size*(int)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 %d bytes of memory\n",iter->stack_size*(int)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 %d bytes of memory\n",(int)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 %d bytes of memory\n",old->stack_size * (int)sizeof(int));
       free(iter);
       return NULL;
     }