=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: oleaut32: Use BOOL type where appropriate.

Alexandre Julliard julliard at winehq.org
Thu Nov 21 14:07:46 CST 2013


Module: wine
Branch: master
Commit: 128e4575e5126e6e79f537693b1dae10a684f7d2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=128e4575e5126e6e79f537693b1dae10a684f7d2

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Wed Nov 20 23:39:29 2013 +0100

oleaut32: Use BOOL type where appropriate.

---

 dlls/oleaut32/olepicture.c |   22 +++++++++++-----------
 dlls/oleaut32/tmarshal.c   |   11 ++++-------
 dlls/oleaut32/typelib.c    |    2 +-
 3 files changed, 16 insertions(+), 19 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..0dec7e7 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -647,14 +647,11 @@ _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 0;
+    return (td->vt == VT_USERDEFINED ||
+            td->vt == VT_VARIANT     ||
+            td->vt == VT_PTR);
 }
 
 static HRESULT
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 0dd3f64..1ebc38b 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 )




More information about the wine-cvs mailing list