Various ANSI C compability fixes.

This commit is contained in:
Patrik Stridvall 1999-07-31 17:34:43 +00:00 committed by Alexandre Julliard
parent b8684a266b
commit 0e38aa7fda
9 changed files with 59 additions and 44 deletions

View File

@ -333,10 +333,10 @@ static void PB_Paint( WND *wndPtr, HDC hDC, WORD action )
* Delegate this to the more generic pushbutton painting
* method.
*/
return BUTTON_DrawPushButton(wndPtr,
hDC,
action,
bHighLighted);
BUTTON_DrawPushButton(wndPtr,
hDC,
action,
bHighLighted);
}
/**********************************************************************
@ -640,10 +640,11 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
BOOL bHighLighted = ((infoPtr->state & BUTTON_HIGHLIGHTED) ||
(infoPtr->state & BUTTON_CHECKED));
return BUTTON_DrawPushButton(wndPtr,
hDC,
action,
bHighLighted);
BUTTON_DrawPushButton(wndPtr,
hDC,
action,
bHighLighted);
return;
}
textlen = 0;

View File

@ -304,7 +304,7 @@ static void MONTHCAL_Refresh (HWND hwnd, HDC hdc)
HBRUSH hbr;
HFONT currentFont;
TEXTMETRICA tm;
// LOGFONTA logFont;
/* LOGFONTA logFont; */
char buf[20],*thisMonthtxt;
COLORREF oldTextColor,oldBkColor;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);

View File

@ -678,8 +678,8 @@ void FILEDLG95_Clean(HWND hwnd)
*/
static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
WORD wNotifyCode = HIWORD(wParam); // notification code
WORD wID = LOWORD(wParam); // item, control, or accelerator identifier
WORD wNotifyCode = HIWORD(wParam); /* notification code */
WORD wID = LOWORD(wParam); /* item, control, or accelerator identifier */
switch(wID)
{

View File

@ -354,7 +354,9 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
IShellView_DestroyViewWindow(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->ShellInfos.hwndView = hwndView;

View File

@ -604,31 +604,31 @@ static void _dump_DDCOLORKEY(void *in) {
static void _dump_surface_desc(DDSURFACEDESC *lpddsd) {
int i;
const struct {
struct {
DWORD mask;
char *name;
void (*func)(void *);
void *elt;
} flags[] = {
#define FE(x,func,elt) { x, #x, func, (void *) &(lpddsd->elt)}
FE(DDSD_CAPS, _dump_DDSCAPS, ddsCaps),
FE(DDSD_HEIGHT, _dump_DWORD, dwHeight),
FE(DDSD_WIDTH, _dump_DWORD, dwWidth),
FE(DDSD_PITCH, _dump_DWORD, lPitch),
FE(DDSD_BACKBUFFERCOUNT, _dump_DWORD, dwBackBufferCount),
FE(DDSD_ZBUFFERBITDEPTH, _dump_DWORD, x.dwZBufferBitDepth),
FE(DDSD_ALPHABITDEPTH, _dump_DWORD, dwAlphaBitDepth),
FE(DDSD_PIXELFORMAT, _dump_pixelformat, ddpfPixelFormat),
FE(DDSD_CKDESTOVERLAY, _dump_DDCOLORKEY, ddckCKDestOverlay),
FE(DDSD_CKDESTBLT, _dump_DDCOLORKEY, ddckCKDestBlt),
FE(DDSD_CKSRCOVERLAY, _dump_DDCOLORKEY, ddckCKSrcOverlay),
FE(DDSD_CKSRCBLT, _dump_DDCOLORKEY, ddckCKSrcBlt),
FE(DDSD_MIPMAPCOUNT, _dump_DWORD, x.dwMipMapCount),
FE(DDSD_REFRESHRATE, _dump_DWORD, x.dwRefreshRate),
FE(DDSD_LINEARSIZE, _dump_DWORD, y.dwLinearSize),
FE(DDSD_LPSURFACE, _dump_PTR, y.lpSurface)
} flags[16], *fe = flags;
#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_HEIGHT, _dump_DWORD, dwHeight);
FE(DDSD_WIDTH, _dump_DWORD, dwWidth);
FE(DDSD_PITCH, _dump_DWORD, lPitch);
FE(DDSD_BACKBUFFERCOUNT, _dump_DWORD, dwBackBufferCount);
FE(DDSD_ZBUFFERBITDEPTH, _dump_DWORD, x.dwZBufferBitDepth);
FE(DDSD_ALPHABITDEPTH, _dump_DWORD, dwAlphaBitDepth);
FE(DDSD_PIXELFORMAT, _dump_pixelformat, ddpfPixelFormat);
FE(DDSD_CKDESTOVERLAY, _dump_DDCOLORKEY, ddckCKDestOverlay);
FE(DDSD_CKDESTBLT, _dump_DDCOLORKEY, ddckCKDestBlt);
FE(DDSD_CKSRCOVERLAY, _dump_DDCOLORKEY, ddckCKSrcOverlay);
FE(DDSD_CKSRCBLT, _dump_DDCOLORKEY, ddckCKSrcBlt);
FE(DDSD_MIPMAPCOUNT, _dump_DWORD, x.dwMipMapCount);
FE(DDSD_REFRESHRATE, _dump_DWORD, x.dwRefreshRate);
FE(DDSD_LINEARSIZE, _dump_DWORD, y.dwLinearSize);
FE(DDSD_LPSURFACE, _dump_PTR, y.lpSurface);
#undef FE
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & lpddsd->dwFlags) {
DPRINTF(" - %s : ",flags[i].name);
@ -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;
for (y = height; y--; ) {
#ifdef __i386__
#if defined(__i386__) && defined(__GNUC__)
/* gcc generates slightly inefficient code for the the copy / lookup,
* it generates one excess memory access (to pal) per pixel. Since
* 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
const unsigned int *pal = (unsigned int *) palette->screen_palents;
for (y = height; y--; ) {
#ifdef __i386__
#if defined(__i386__) && defined(__GNUC__)
/* See comment in pixel_convert_16_to_8 */
__asm__ __volatile__(
"xor %%eax,%%eax\n"

View File

@ -686,9 +686,9 @@ struct IUnknown {
#endif /* ICOM_CINTERFACE */
ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj);
ICOM_METHOD (ULONG,AddRef);
ICOM_METHOD (ULONG,Release);
ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj)
ICOM_METHOD (ULONG,AddRef)
ICOM_METHOD (ULONG,Release)
};
#undef ICOM_INTERFACE

View File

@ -389,7 +389,7 @@ static void DOSMEM_InitMemory(HMODULE16 hModule)
*/
static void DOSMEM_MovePointers(LPVOID dest, LPVOID src, DWORD size)
{
unsigned long delta = dest-src;
unsigned long delta = (char *) dest - (char *) src;
unsigned cnt;
ldt_entry ent;

View File

@ -3183,7 +3183,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
ULONG propertyIndex;
BOOL successRead, successWrite;
StgProperty chainProperty;
BYTE buffer[DEF_SMALL_BLOCK_SIZE];
BYTE *buffer;
BlockChainStream *bbTempChain = NULL;
BlockChainStream *bigBlockChain = NULL;
@ -3211,11 +3211,12 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
cbTotalRead = 0;
cbTotalWritten = 0;
buffer = (BYTE *) malloc(DEF_SMALL_BLOCK_SIZE);
do
{
successRead = SmallBlockChainStream_ReadAt(*ppsbChain,
offset,
sizeof(buffer),
DEF_SMALL_BLOCK_SIZE,
buffer,
&cbRead);
cbTotalRead += cbRead;
@ -3230,6 +3231,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
offset.LowPart += This->smallBlockSize;
} while (successRead && successWrite);
free(buffer);
assert(cbTotalRead == cbTotalWritten);

View File

@ -466,8 +466,13 @@ void RDW_ValidateParent(WND *wndChild)
HRGN hrg;
if (wndChild->hrgnUpdate == 1 )
{
RECT r = {0, 0, wndChild->rectWindow.right - wndChild->rectWindow.left,
wndChild->rectWindow.bottom - wndChild->rectWindow.top };
RECT r;
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 );
}
else
@ -478,8 +483,13 @@ void RDW_ValidateParent(WND *wndChild)
RECT rect, rectParent;
if( wndParent->hrgnUpdate == 1 )
{
RECT r = {0, 0, wndParent->rectWindow.right - wndParent->rectWindow.left,
wndParent->rectWindow.bottom - wndParent->rectWindow.top };
RECT r;
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 );
}
/* we must offset the child region by the offset of the child rect in the parent */