# HG changeset patch # User reimar # Date 1308510926 0 # Node ID 835841f893154769444537884b8d74fe6458cbfc # Parent 0d3ac97aed9247b8e08e32b6769374abb6ab6613 Use the proper type for the palette, fixes compiler warning. diff -r 0d3ac97aed92 -r 835841f89315 libvo/vo_directx.c --- a/libvo/vo_directx.c Sun Jun 19 19:05:39 2011 +0000 +++ b/libvo/vo_directx.c Sun Jun 19 19:15:26 2011 +0000 @@ -1005,13 +1005,13 @@ //create palette for 256 color mode if(image_format==IMGFMT_BGR8){ LPDIRECTDRAWPALETTE ddpalette=NULL; - char* palette=malloc(4*256); + LPPALETTEENTRY palette=calloc(256, sizeof(*palette)); int i; for(i=0; i<256; i++){ - palette[4*i+0] = ((i >> 5) & 0x07) * 255 / 7; - palette[4*i+1] = ((i >> 2) & 0x07) * 255 / 7; - palette[4*i+2] = ((i >> 0) & 0x03) * 255 / 3; - palette[4*i+3] = PC_NOCOLLAPSE; + palette[i].peRed = ((i >> 5) & 0x07) * 255 / 7; + palette[i].peGreen = ((i >> 2) & 0x07) * 255 / 7; + palette[i].peBlue = ((i >> 0) & 0x03) * 255 / 3; + palette[i].peFlags = PC_NOCOLLAPSE; } g_lpdd->lpVtbl->CreatePalette(g_lpdd,DDPCAPS_8BIT|DDPCAPS_INITIALIZE,palette,&ddpalette,NULL); g_lpddsPrimary->lpVtbl->SetPalette(g_lpddsPrimary,ddpalette);