Clean-up in I830AllocVidMem(), s/int/unsigned long/ for ret variable.
authorBrian <brian@yutani.localnet.net>
Wed, 9 May 2007 14:07:10 +0000 (08:07 -0600)
committerBrian <brian@yutani.localnet.net>
Wed, 9 May 2007 14:07:15 +0000 (08:07 -0600)
src/mesa/drivers/dri/i915/server/intel_dri.c
src/mesa/drivers/dri/i915tex/server/intel_dri.c

index 169fdbe..b6946b7 100644 (file)
@@ -455,12 +455,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l
 }
 
 unsigned long
-I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags)
+I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830,
+                I830MemRange *result, I830MemPool *pool, long size,
+                unsigned long alignment, int flags)
 {
-  int ret;
+   unsigned long ret;
 
-  if (!result)
-    return 0;
+   if (!result)
+      return 0;
 
    /* Make sure these are initialised. */
    result->Size = 0;
@@ -470,16 +472,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul
       return 0;
    }
 
-   if (pool->Free.Size < size)
-     return AllocFromAGP(ctx, pI830, size, alignment, result);
-   else
-   {
-     ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
-
-     if (ret==0)
-       return AllocFromAGP(ctx, pI830, size, alignment, result);
-     return ret;
+   if (pool->Free.Size < size) {
+      ret = AllocFromAGP(ctx, pI830, size, alignment, result);
+   }
+   else {
+      ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
+      if (ret == 0)
+         ret = AllocFromAGP(ctx, pI830, size, alignment, result);
    }
+   return ret;
 }
 
 static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem)
index 2d425d0..e49c421 100644 (file)
@@ -483,12 +483,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l
 }
 
 unsigned long
-I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags)
+I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830,
+                I830MemRange *result, I830MemPool *pool, long size,
+                unsigned long alignment, int flags)
 {
-  int ret;
+   unsigned long ret;
 
-  if (!result)
-    return 0;
+   if (!result)
+      return 0;
 
    /* Make sure these are initialised. */
    result->Size = 0;
@@ -498,16 +500,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul
       return 0;
    }
 
-   if (pool->Free.Size < size)
-     return AllocFromAGP(ctx, pI830, size, alignment, result);
-   else
-   {
-     ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
-
-     if (ret==0)
-       return AllocFromAGP(ctx, pI830, size, alignment, result);
-     return ret;
+   if (pool->Free.Size < size) {
+      ret = AllocFromAGP(ctx, pI830, size, alignment, result);
+   }
+   else {
+      ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
+      if (ret == 0)
+         ret = AllocFromAGP(ctx, pI830, size, alignment, result);
    }
+   return ret;
 }
 
 static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem)