oleaut32: Use BOOL type where appropriate
Frédéric Delanoy
frederic.delanoy at gmail.com
Wed Nov 20 16:39:29 CST 2013
---
dlls/oleaut32/olepicture.c | 22 +++++++++++-----------
dlls/oleaut32/tmarshal.c | 6 +++---
dlls/oleaut32/typelib.c | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 2772a2f..5e81766 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -1527,9 +1527,9 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm)
return hr;
}
-static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLength)
+static BOOL serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLength)
{
- int iSuccess = 0;
+ BOOL success = FALSE;
HDC hDC;
BITMAPINFO * pInfoBitmap;
int iNumPaletteEntries;
@@ -1585,17 +1585,17 @@ static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLengt
sizeof(BITMAPINFOHEADER) +
iNumPaletteEntries * sizeof(RGBQUAD),
pPixelData, pInfoBitmap->bmiHeader.biSizeImage);
- iSuccess = 1;
+ success = TRUE;
HeapFree(GetProcessHeap(), 0, pPixelData);
HeapFree(GetProcessHeap(), 0, pInfoBitmap);
- return iSuccess;
+ return success;
}
-static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
+static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
{
ICONINFO infoIcon;
- int iSuccess = 0;
+ BOOL success = FALSE;
*ppBuffer = NULL; *pLength = 0;
if (GetIconInfo(hIcon, &infoIcon)) {
@@ -1717,7 +1717,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
/* Write out everything produced so far to the stream */
*ppBuffer = pIconData; *pLength = iDataSize;
- iSuccess = 1;
+ success = TRUE;
} else {
/*
printf("ERROR: unable to get bitmap information via GetDIBits() (error %u)\n",
@@ -1740,7 +1740,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
printf("ERROR: Unable to get icon information (error %u)\n",
GetLastError());
}
- return iSuccess;
+ return success;
}
static HRESULT WINAPI OLEPictureImpl_Save(
@@ -1751,7 +1751,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
unsigned int iDataSize;
DWORD header[2];
ULONG dummy;
- int iSerializeResult = 0;
+ BOOL serializeResult = FALSE;
OLEPictureImpl *This = impl_from_IPersistStream(iface);
TRACE("%p %p %d\n", This, pStm, fClearDirty);
@@ -1785,7 +1785,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
if (This->bIsDirty || !This->data) {
switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP) {
case BITMAP_FORMAT_BMP:
- iSerializeResult = serializeBMP(This->desc.u.bmp.hbitmap, &pIconData, &iDataSize);
+ serializeResult = serializeBMP(This->desc.u.bmp.hbitmap, &pIconData, &iDataSize);
break;
case BITMAP_FORMAT_JPEG:
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format JPEG) not implemented!\n",This,pStm,fClearDirty);
@@ -1801,7 +1801,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
break;
}
- if (!iSerializeResult)
+ if (!serializeResult)
{
hResult = E_FAIL;
break;
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 3856f32..8eb666f 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -647,14 +647,14 @@ _xsize(const TYPEDESC *td, ITypeInfo *tinfo) {
}
/* Whether we pass this type by reference or by value */
-static int
+static BOOL
_passbyref(const TYPEDESC *td, ITypeInfo *tinfo) {
if (td->vt == VT_USERDEFINED ||
td->vt == VT_VARIANT ||
td->vt == VT_PTR)
- return 1;
+ return TRUE;
- return 0;
+ return FALSE;
}
static HRESULT
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index dcbea96..0d8c43e 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -3137,7 +3137,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
/* Read in NE header */
nehdoffset = LZSeek( lzfd, 0, SEEK_CUR );
- if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return 0;
+ if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return FALSE;
resTabSize = nehd.ne_restab - nehd.ne_rsrctab;
if ( !resTabSize )
--
1.8.4.3
More information about the wine-patches
mailing list