changeset 2425:d0bcc85d3856 libavcodec

10l (gcc 2.95 fix)
author michael
date Wed, 12 Jan 2005 11:14:12 +0000
parents 35ca0ef0c279
children 1ee03f2a6cd5
files mem.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mem.c	Wed Jan 12 01:44:02 2005 +0000
+++ b/mem.c	Wed Jan 12 11:14:12 2005 +0000
@@ -45,13 +45,13 @@
 void *av_malloc(unsigned int size)
 {
     void *ptr;
+    int diff;
 
     /* lets disallow possible ambiguous cases */
     if(size > INT_MAX)
         return NULL;
     
 #ifdef MEMALIGN_HACK
-    int diff;
     ptr = malloc(size+16+1);
     diff= ((-(int)ptr - 1)&15) + 1;
     ptr += diff;
@@ -97,13 +97,13 @@
  */
 void *av_realloc(void *ptr, unsigned int size)
 {
+    int diff;
     /* lets disallow possible ambiguous cases */
     if(size > INT_MAX)
         return NULL;
 
 #ifdef MEMALIGN_HACK
     //FIXME this isnt aligned correctly though it probably isnt needed
-    int diff;
     if(!ptr) return av_malloc(size);
     diff= ((char*)ptr)[-1];
     return realloc(ptr - diff, size + diff) + diff;