Michael Stefaniuc : ole32: Use the right FAILED/ SUCCEEDED macro instead of negating the opposite.
Alexandre Julliard
julliard at winehq.org
Wed Oct 8 08:32:53 CDT 2008
Module: wine
Branch: master
Commit: 3ed8ffcc99e46269a9d0b6b7a2a9e9bfd36d2eee
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ed8ffcc99e46269a9d0b6b7a2a9e9bfd36d2eee
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Wed Oct 8 01:32:53 2008 +0200
ole32: Use the right FAILED/SUCCEEDED macro instead of negating the opposite.
---
dlls/ole32/clipboard.c | 2 +-
dlls/ole32/filemoniker.c | 16 ++++++++--------
dlls/ole32/storage32.c | 8 ++++----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
index 909b215..0e9d55c 100644
--- a/dlls/ole32/clipboard.c
+++ b/dlls/ole32/clipboard.c
@@ -956,7 +956,7 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF
/* Get the metafile picture out of it */
- if (!FAILED(hr = IDataObject_GetData(theOleClipboard->pIDataObjectSrc, &fmt2, &std2)))
+ if (SUCCEEDED(hr = IDataObject_GetData(theOleClipboard->pIDataObjectSrc, &fmt2, &std2)))
{
mfp = (METAFILEPICT *)GlobalLock(std2.u.hGlobal);
}
diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index 74c867a..3dae139 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -358,12 +358,12 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
/* write a 0 WORD */
res=IStream_Write(pStm,&ZERO,sizeof(WORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write length of filePath string ( 0 included )*/
bytesA = WideCharToMultiByte( CP_ACP, 0, filePathW, -1, NULL, 0, NULL, NULL );
res=IStream_Write(pStm,&bytesA,sizeof(DWORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write A string (with '\0') */
filePathA=HeapAlloc(GetProcessHeap(),0,bytesA);
@@ -372,17 +372,17 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
WideCharToMultiByte( CP_ACP, 0, filePathW, -1, filePathA, bytesA, NULL, &bUsedDefault);
res=IStream_Write(pStm,filePathA,bytesA,NULL);
HeapFree(GetProcessHeap(),0,filePathA);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write a DWORD 0xDEADFFFF */
res=IStream_Write(pStm,&DEADFFFF,sizeof(DWORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write 5 zero DWORDs */
for(i=0;i<5;i++)
{
res=IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
}
/* Write the wide version if:
@@ -414,16 +414,16 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
/* write bytes needed for the filepathW (without 0) + 6 */
bytesW = len*sizeof(WCHAR) + 6;
res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* try again, without the extra 6 */
bytesW -= 6;
res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write a WORD 3 */
res=IStream_Write(pStm,&THREE,sizeof(WORD),NULL);
- if (!SUCCEEDED(res)) return res;
+ if (FAILED(res)) return res;
/* write W string (no 0) */
res=IStream_Write(pStm,filePathW,bytesW,NULL);
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 705585b..180619a 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1906,7 +1906,7 @@ static HRESULT WINAPI StorageImpl_Stat( IStorage* iface,
StorageImpl* const This = (StorageImpl*)iface;
HRESULT result = StorageBaseImpl_Stat( iface, pstatstg, grfStatFlag );
- if ( !FAILED(result) && ((grfStatFlag & STATFLAG_NONAME) == 0) && This->pwcsName )
+ if ( SUCCEEDED(result) && ((grfStatFlag & STATFLAG_NONAME) == 0) && This->pwcsName )
{
CoTaskMemFree(pstatstg->pwcsName);
pstatstg->pwcsName = CoTaskMemAlloc((lstrlenW(This->pwcsName)+1)*sizeof(WCHAR));
@@ -6335,13 +6335,13 @@ HRESULT WINAPI OleLoadFromStream(IStream *pStm,REFIID iidInterface,void** ppvOb
TRACE("(%p,%s,%p)\n",pStm,debugstr_guid(iidInterface),ppvObj);
res=ReadClassStm(pStm,&clsid);
- if (!SUCCEEDED(res))
+ if (FAILED(res))
return res;
res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj);
- if (!SUCCEEDED(res))
+ if (FAILED(res))
return res;
res=IUnknown_QueryInterface((IUnknown*)*ppvObj,&IID_IPersistStream,(LPVOID*)&xstm);
- if (!SUCCEEDED(res)) {
+ if (FAILED(res)) {
IUnknown_Release((IUnknown*)*ppvObj);
return res;
}
More information about the wine-cvs
mailing list