gdi32: Work around a gcc array out of bounds warning.

This commit is contained in:
Alexandre Julliard 2012-07-23 14:51:50 +02:00
parent 9083bcc59c
commit 592e6aa942
1 changed files with 4 additions and 11 deletions

View File

@ -89,18 +89,11 @@ HPALETTE PALETTE_Init(void)
palPtr->palVersion = 0x300;
palPtr->palNumEntries = 20;
for (i = 0; i < 10; i++)
for (i = 0; i < 20; i++)
{
palPtr->palPalEntry[i].peRed = entries[i].rgbRed;
palPtr->palPalEntry[i].peGreen = entries[i].rgbGreen;
palPtr->palPalEntry[i].peBlue = entries[i].rgbBlue;
palPtr->palPalEntry[i].peFlags = 0;
}
for (i = 10; i < 20; i++)
{
palPtr->palPalEntry[i].peRed = entries[236 + i].rgbRed;
palPtr->palPalEntry[i].peGreen = entries[236 + i].rgbGreen;
palPtr->palPalEntry[i].peBlue = entries[236 + i].rgbBlue;
palPtr->palPalEntry[i].peRed = entries[i < 10 ? i : 236 + i].rgbRed;
palPtr->palPalEntry[i].peGreen = entries[i < 10 ? i : 236 + i].rgbGreen;
palPtr->palPalEntry[i].peBlue = entries[i < 10 ? i : 236 + i].rgbBlue;
palPtr->palPalEntry[i].peFlags = 0;
}
return CreatePalette( palPtr );