d3dx9_36: Push down the scope of two variables.

Gerald Pfeifer gerald at pfeifer.com
Sat Feb 26 14:04:02 CST 2011


I noticed this opportunity while looking for something else; it
makes things simpler (and easier to understand).

Gerald

---
 dlls/d3dx9_36/surface.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 1bc2d54..a3e6e68 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -677,7 +677,7 @@ static void copy_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsize,
                              D3DCOLOR colorkey)
 {
     struct argb_conversion_info conv_info, ck_conv_info;
-    DWORD channels[4], pixel;
+    DWORD channels[4];
     UINT minwidth, minheight;
     UINT x, y;
 
@@ -701,6 +701,8 @@ static void copy_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsize,
         DWORD val = 0;
 
         for(x = 0;x < minwidth;x++) {
+            DWORD pixel;
+
             /* extract source color components */
             if(srcformat->type == FORMAT_ARGB) {
                 pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel);
@@ -745,7 +747,7 @@ static void point_filter_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsi
                                      D3DCOLOR colorkey)
 {
     struct argb_conversion_info conv_info, ck_conv_info;
-    DWORD channels[4], pixel;
+    DWORD channels[4];
 
     UINT x, y;
 
@@ -766,7 +768,7 @@ static void point_filter_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsi
 
         for(x = 0;x < destsize.x;x++) {
             const BYTE *srcptr = bufptr + (x * srcsize.x / destsize.x) * srcformat->bytes_per_pixel;
-            DWORD val = 0;
+            DWORD val = 0, pixel;
 
             /* extract source color components */
             if(srcformat->type == FORMAT_ARGB) {
-- 
1.7.4.1



More information about the wine-patches mailing list