Alexandre Julliard : gdiplus/tests: Add an intermediate variable to avoid array bounds warnings.

Alexandre Julliard julliard at winehq.org
Thu Oct 20 14:25:10 CDT 2011


Module: wine
Branch: master
Commit: 7c1f665627202c98ecba8e5db0fa752d64720ae5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7c1f665627202c98ecba8e5db0fa752d64720ae5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 20 12:49:53 2011 +0200

gdiplus/tests: Add an intermediate variable to avoid array bounds warnings.

---

 dlls/gdiplus/tests/image.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index 8535aad..6e4aca5 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -1776,6 +1776,7 @@ static void test_palette(void)
     INT size;
     BYTE buffer[1040];
     ColorPalette *palette=(ColorPalette*)buffer;
+    ARGB *entries = palette->Entries;
     ARGB color=0;
 
     /* test initial palette from non-indexed bitmap */
@@ -1819,8 +1820,8 @@ static void test_palette(void)
     expect(PaletteFlagsGrayScale, palette->Flags);
     expect(2, palette->Count);
 
-    expect(0xff000000, palette->Entries[0]);
-    expect(0xffffffff, palette->Entries[1]);
+    expect(0xff000000, entries[0]);
+    expect(0xffffffff, entries[1]);
 
     /* test getting/setting pixels */
     stat = GdipBitmapGetPixel(bitmap, 0, 0, &color);
@@ -1905,12 +1906,12 @@ static void test_palette(void)
     }
 
     /* test setting/getting a different palette */
-    palette->Entries[1] = 0xffcccccc;
+    entries[1] = 0xffcccccc;
 
     stat = GdipSetImagePalette((GpImage*)bitmap, palette);
     expect(Ok, stat);
 
-    palette->Entries[1] = 0;
+    entries[1] = 0;
 
     stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size);
     expect(Ok, stat);
@@ -1920,7 +1921,7 @@ static void test_palette(void)
     expect(Ok, stat);
     expect(PaletteFlagsHalftone, palette->Flags);
     expect(256, palette->Count);
-    expect(0xffcccccc, palette->Entries[1]);
+    expect(0xffcccccc, entries[1]);
 
     /* test count < 256 */
     palette->Flags = 12345;
@@ -1929,8 +1930,8 @@ static void test_palette(void)
     stat = GdipSetImagePalette((GpImage*)bitmap, palette);
     expect(Ok, stat);
 
-    palette->Entries[1] = 0;
-    palette->Entries[3] = 0xdeadbeef;
+    entries[1] = 0;
+    entries[3] = 0xdeadbeef;
 
     stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size);
     expect(Ok, stat);
@@ -1940,8 +1941,8 @@ static void test_palette(void)
     expect(Ok, stat);
     expect(12345, palette->Flags);
     expect(3, palette->Count);
-    expect(0xffcccccc, palette->Entries[1]);
-    expect(0xdeadbeef, palette->Entries[3]);
+    expect(0xffcccccc, entries[1]);
+    expect(0xdeadbeef, entries[3]);
 
     /* test count > 256 */
     palette->Count = 257;




More information about the wine-cvs mailing list