Commit 0e38aa7f authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

Various ANSI C compability fixes.

parent b8684a26
...@@ -333,7 +333,7 @@ static void PB_Paint( WND *wndPtr, HDC hDC, WORD action ) ...@@ -333,7 +333,7 @@ static void PB_Paint( WND *wndPtr, HDC hDC, WORD action )
* Delegate this to the more generic pushbutton painting * Delegate this to the more generic pushbutton painting
* method. * method.
*/ */
return BUTTON_DrawPushButton(wndPtr, BUTTON_DrawPushButton(wndPtr,
hDC, hDC,
action, action,
bHighLighted); bHighLighted);
...@@ -640,10 +640,11 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action ) ...@@ -640,10 +640,11 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
BOOL bHighLighted = ((infoPtr->state & BUTTON_HIGHLIGHTED) || BOOL bHighLighted = ((infoPtr->state & BUTTON_HIGHLIGHTED) ||
(infoPtr->state & BUTTON_CHECKED)); (infoPtr->state & BUTTON_CHECKED));
return BUTTON_DrawPushButton(wndPtr, BUTTON_DrawPushButton(wndPtr,
hDC, hDC,
action, action,
bHighLighted); bHighLighted);
return;
} }
textlen = 0; textlen = 0;
......
...@@ -304,7 +304,7 @@ static void MONTHCAL_Refresh (HWND hwnd, HDC hdc) ...@@ -304,7 +304,7 @@ static void MONTHCAL_Refresh (HWND hwnd, HDC hdc)
HBRUSH hbr; HBRUSH hbr;
HFONT currentFont; HFONT currentFont;
TEXTMETRICA tm; TEXTMETRICA tm;
// LOGFONTA logFont; /* LOGFONTA logFont; */
char buf[20],*thisMonthtxt; char buf[20],*thisMonthtxt;
COLORREF oldTextColor,oldBkColor; COLORREF oldTextColor,oldBkColor;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
......
...@@ -678,8 +678,8 @@ void FILEDLG95_Clean(HWND hwnd) ...@@ -678,8 +678,8 @@ void FILEDLG95_Clean(HWND hwnd)
*/ */
static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
WORD wNotifyCode = HIWORD(wParam); // notification code WORD wNotifyCode = HIWORD(wParam); /* notification code */
WORD wID = LOWORD(wParam); // item, control, or accelerator identifier WORD wID = LOWORD(wParam); /* item, control, or accelerator identifier */
switch(wID) switch(wID)
{ {
......
...@@ -354,7 +354,9 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, ...@@ -354,7 +354,9 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView); IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
IShellView_Release(fodInfos->Shell.FOIShellView); IShellView_Release(fodInfos->Shell.FOIShellView);
} }
//ShowWindow(fodInfos->ShellInfos.hwndView,SW_HIDE); #if 0
ShowWindow(fodInfos->ShellInfos.hwndView,SW_HIDE);
#endif
fodInfos->Shell.FOIShellView = psvTmp; fodInfos->Shell.FOIShellView = psvTmp;
fodInfos->ShellInfos.hwndView = hwndView; fodInfos->ShellInfos.hwndView = hwndView;
......
...@@ -604,31 +604,31 @@ static void _dump_DDCOLORKEY(void *in) { ...@@ -604,31 +604,31 @@ static void _dump_DDCOLORKEY(void *in) {
static void _dump_surface_desc(DDSURFACEDESC *lpddsd) { static void _dump_surface_desc(DDSURFACEDESC *lpddsd) {
int i; int i;
const struct { struct {
DWORD mask; DWORD mask;
char *name; char *name;
void (*func)(void *); void (*func)(void *);
void *elt; void *elt;
} flags[] = { } flags[16], *fe = flags;
#define FE(x,func,elt) { x, #x, func, (void *) &(lpddsd->elt)} #define FE(x,f,e) do { fe->mask = x; fe->name = #x; fe->func = f; fe->elt = (void *) &(lpddsd->e); fe++; } while(0)
FE(DDSD_CAPS, _dump_DDSCAPS, ddsCaps), FE(DDSD_CAPS, _dump_DDSCAPS, ddsCaps);
FE(DDSD_HEIGHT, _dump_DWORD, dwHeight), FE(DDSD_HEIGHT, _dump_DWORD, dwHeight);
FE(DDSD_WIDTH, _dump_DWORD, dwWidth), FE(DDSD_WIDTH, _dump_DWORD, dwWidth);
FE(DDSD_PITCH, _dump_DWORD, lPitch), FE(DDSD_PITCH, _dump_DWORD, lPitch);
FE(DDSD_BACKBUFFERCOUNT, _dump_DWORD, dwBackBufferCount), FE(DDSD_BACKBUFFERCOUNT, _dump_DWORD, dwBackBufferCount);
FE(DDSD_ZBUFFERBITDEPTH, _dump_DWORD, x.dwZBufferBitDepth), FE(DDSD_ZBUFFERBITDEPTH, _dump_DWORD, x.dwZBufferBitDepth);
FE(DDSD_ALPHABITDEPTH, _dump_DWORD, dwAlphaBitDepth), FE(DDSD_ALPHABITDEPTH, _dump_DWORD, dwAlphaBitDepth);
FE(DDSD_PIXELFORMAT, _dump_pixelformat, ddpfPixelFormat), FE(DDSD_PIXELFORMAT, _dump_pixelformat, ddpfPixelFormat);
FE(DDSD_CKDESTOVERLAY, _dump_DDCOLORKEY, ddckCKDestOverlay), FE(DDSD_CKDESTOVERLAY, _dump_DDCOLORKEY, ddckCKDestOverlay);
FE(DDSD_CKDESTBLT, _dump_DDCOLORKEY, ddckCKDestBlt), FE(DDSD_CKDESTBLT, _dump_DDCOLORKEY, ddckCKDestBlt);
FE(DDSD_CKSRCOVERLAY, _dump_DDCOLORKEY, ddckCKSrcOverlay), FE(DDSD_CKSRCOVERLAY, _dump_DDCOLORKEY, ddckCKSrcOverlay);
FE(DDSD_CKSRCBLT, _dump_DDCOLORKEY, ddckCKSrcBlt), FE(DDSD_CKSRCBLT, _dump_DDCOLORKEY, ddckCKSrcBlt);
FE(DDSD_MIPMAPCOUNT, _dump_DWORD, x.dwMipMapCount), FE(DDSD_MIPMAPCOUNT, _dump_DWORD, x.dwMipMapCount);
FE(DDSD_REFRESHRATE, _dump_DWORD, x.dwRefreshRate), FE(DDSD_REFRESHRATE, _dump_DWORD, x.dwRefreshRate);
FE(DDSD_LINEARSIZE, _dump_DWORD, y.dwLinearSize), FE(DDSD_LINEARSIZE, _dump_DWORD, y.dwLinearSize);
FE(DDSD_LPSURFACE, _dump_PTR, y.lpSurface) FE(DDSD_LPSURFACE, _dump_PTR, y.lpSurface);
#undef FE #undef FE
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & lpddsd->dwFlags) { if (flags[i].mask & lpddsd->dwFlags) {
DPRINTF(" - %s : ",flags[i].name); DPRINTF(" - %s : ",flags[i].name);
...@@ -3525,7 +3525,7 @@ static void pixel_convert_16_to_8(void *src, void *dst, DWORD width, DWORD heigh ...@@ -3525,7 +3525,7 @@ static void pixel_convert_16_to_8(void *src, void *dst, DWORD width, DWORD heigh
const unsigned short * pal = (unsigned short *) palette->screen_palents; const unsigned short * pal = (unsigned short *) palette->screen_palents;
for (y = height; y--; ) { for (y = height; y--; ) {
#ifdef __i386__ #if defined(__i386__) && defined(__GNUC__)
/* gcc generates slightly inefficient code for the the copy / lookup, /* gcc generates slightly inefficient code for the the copy / lookup,
* it generates one excess memory access (to pal) per pixel. Since * it generates one excess memory access (to pal) per pixel. Since
* we know that pal is not modified by the memory write we can * we know that pal is not modified by the memory write we can
...@@ -3615,7 +3615,7 @@ static void pixel_convert_32_to_8(void *src, void *dst, DWORD width, DWORD heigh ...@@ -3615,7 +3615,7 @@ static void pixel_convert_32_to_8(void *src, void *dst, DWORD width, DWORD heigh
const unsigned int *pal = (unsigned int *) palette->screen_palents; const unsigned int *pal = (unsigned int *) palette->screen_palents;
for (y = height; y--; ) { for (y = height; y--; ) {
#ifdef __i386__ #if defined(__i386__) && defined(__GNUC__)
/* See comment in pixel_convert_16_to_8 */ /* See comment in pixel_convert_16_to_8 */
__asm__ __volatile__( __asm__ __volatile__(
"xor %%eax,%%eax\n" "xor %%eax,%%eax\n"
......
...@@ -686,9 +686,9 @@ struct IUnknown { ...@@ -686,9 +686,9 @@ struct IUnknown {
#endif /* ICOM_CINTERFACE */ #endif /* ICOM_CINTERFACE */
ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj); ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj)
ICOM_METHOD (ULONG,AddRef); ICOM_METHOD (ULONG,AddRef)
ICOM_METHOD (ULONG,Release); ICOM_METHOD (ULONG,Release)
}; };
#undef ICOM_INTERFACE #undef ICOM_INTERFACE
......
...@@ -389,7 +389,7 @@ static void DOSMEM_InitMemory(HMODULE16 hModule) ...@@ -389,7 +389,7 @@ static void DOSMEM_InitMemory(HMODULE16 hModule)
*/ */
static void DOSMEM_MovePointers(LPVOID dest, LPVOID src, DWORD size) static void DOSMEM_MovePointers(LPVOID dest, LPVOID src, DWORD size)
{ {
unsigned long delta = dest-src; unsigned long delta = (char *) dest - (char *) src;
unsigned cnt; unsigned cnt;
ldt_entry ent; ldt_entry ent;
......
...@@ -3183,7 +3183,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks( ...@@ -3183,7 +3183,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
ULONG propertyIndex; ULONG propertyIndex;
BOOL successRead, successWrite; BOOL successRead, successWrite;
StgProperty chainProperty; StgProperty chainProperty;
BYTE buffer[DEF_SMALL_BLOCK_SIZE]; BYTE *buffer;
BlockChainStream *bbTempChain = NULL; BlockChainStream *bbTempChain = NULL;
BlockChainStream *bigBlockChain = NULL; BlockChainStream *bigBlockChain = NULL;
...@@ -3211,11 +3211,12 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks( ...@@ -3211,11 +3211,12 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
cbTotalRead = 0; cbTotalRead = 0;
cbTotalWritten = 0; cbTotalWritten = 0;
buffer = (BYTE *) malloc(DEF_SMALL_BLOCK_SIZE);
do do
{ {
successRead = SmallBlockChainStream_ReadAt(*ppsbChain, successRead = SmallBlockChainStream_ReadAt(*ppsbChain,
offset, offset,
sizeof(buffer), DEF_SMALL_BLOCK_SIZE,
buffer, buffer,
&cbRead); &cbRead);
cbTotalRead += cbRead; cbTotalRead += cbRead;
...@@ -3230,6 +3231,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks( ...@@ -3230,6 +3231,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
offset.LowPart += This->smallBlockSize; offset.LowPart += This->smallBlockSize;
} while (successRead && successWrite); } while (successRead && successWrite);
free(buffer);
assert(cbTotalRead == cbTotalWritten); assert(cbTotalRead == cbTotalWritten);
......
...@@ -466,8 +466,13 @@ void RDW_ValidateParent(WND *wndChild) ...@@ -466,8 +466,13 @@ void RDW_ValidateParent(WND *wndChild)
HRGN hrg; HRGN hrg;
if (wndChild->hrgnUpdate == 1 ) if (wndChild->hrgnUpdate == 1 )
{ {
RECT r = {0, 0, wndChild->rectWindow.right - wndChild->rectWindow.left, RECT r;
wndChild->rectWindow.bottom - wndChild->rectWindow.top };
r.left = 0;
r.top = 0;
r.right = wndChild->rectWindow.right - wndChild->rectWindow.left;
r.bottom = wndChild->rectWindow.bottom - wndChild->rectWindow.top;
hrg = CreateRectRgnIndirect( &r ); hrg = CreateRectRgnIndirect( &r );
} }
else else
...@@ -478,8 +483,13 @@ void RDW_ValidateParent(WND *wndChild) ...@@ -478,8 +483,13 @@ void RDW_ValidateParent(WND *wndChild)
RECT rect, rectParent; RECT rect, rectParent;
if( wndParent->hrgnUpdate == 1 ) if( wndParent->hrgnUpdate == 1 )
{ {
RECT r = {0, 0, wndParent->rectWindow.right - wndParent->rectWindow.left, RECT r;
wndParent->rectWindow.bottom - wndParent->rectWindow.top };
r.left = 0;
r.top = 0;
r.right = wndParent->rectWindow.right - wndParent->rectWindow.left;
r.bottom = wndParent->rectWindow.bottom - wndParent->rectWindow.top;
wndParent->hrgnUpdate = CreateRectRgnIndirect( &r ); wndParent->hrgnUpdate = CreateRectRgnIndirect( &r );
} }
/* we must offset the child region by the offset of the child rect in the parent */ /* we must offset the child region by the offset of the child rect in the parent */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment