ole32: Remove redundant variables.

This commit is contained in:
Nikolay Sivov 2010-07-21 14:03:35 +04:00 committed by Alexandre Julliard
parent 6fb39dfe4a
commit 5185409144
6 changed files with 16 additions and 42 deletions

View File

@ -192,13 +192,9 @@ AntiMonikerImpl_Load(IMoniker* iface,IStream* pStm)
static HRESULT WINAPI
AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDirty)
{
DWORD constant=1;
HRESULT res;
static const DWORD constant = 1;
/* data written by this function is only a DWORD constant set to 1 ! */
res=IStream_Write(pStm,&constant,sizeof(constant),NULL);
return res;
return IStream_Write(pStm,&constant,sizeof(constant),NULL);
}
/******************************************************************************
@ -614,9 +610,8 @@ static HRESULT AntiMonikerImpl_Construct(AntiMonikerImpl* This)
******************************************************************************/
HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
{
AntiMonikerImpl* newAntiMoniker = 0;
HRESULT hr = S_OK;
IID riid=IID_IMoniker;
AntiMonikerImpl* newAntiMoniker;
HRESULT hr;
TRACE("(%p)\n",ppmk);
@ -632,9 +627,7 @@ HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
return hr;
}
hr = AntiMonikerImpl_QueryInterface((IMoniker*)newAntiMoniker,&riid,(void**)ppmk);
return hr;
return AntiMonikerImpl_QueryInterface((IMoniker*)newAntiMoniker,&IID_IMoniker,(void**)ppmk);
}
static HRESULT WINAPI AntiMonikerCF_QueryInterface(LPCLASSFACTORY iface,
@ -677,7 +670,7 @@ static HRESULT WINAPI AntiMonikerCF_CreateInstance(LPCLASSFACTORY iface,
if (FAILED(hr))
return hr;
hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
hr = IMoniker_QueryInterface(pMoniker, riid, ppv);
if (FAILED(hr))
IMoniker_Release(pMoniker);

View File

@ -285,8 +285,6 @@ BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
static HRESULT WINAPI
BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
{
HRESULT res;
BindCtxImpl *This = (BindCtxImpl *)iface;
TRACE("(%p,%p)\n",This,pprot);
@ -294,9 +292,7 @@ BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectTable** pprot)
if (pprot==NULL)
return E_POINTER;
res=GetRunningObjectTable(0, pprot);
return res;
return GetRunningObjectTable(0, pprot);
}
/******************************************************************************
@ -555,9 +551,8 @@ static HRESULT BindCtxImpl_Construct(BindCtxImpl* This)
*/
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc)
{
BindCtxImpl* newBindCtx = 0;
BindCtxImpl* newBindCtx;
HRESULT hr;
IID riid=IID_IBindCtx;
TRACE("(%d,%p)\n",reserved,ppbc);
@ -582,9 +577,7 @@ HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc)
return hr;
}
hr = BindCtxImpl_QueryInterface((IBindCtx*)newBindCtx,&riid,(void**)ppbc);
return hr;
return BindCtxImpl_QueryInterface((IBindCtx*)newBindCtx,&IID_IBindCtx,(void**)ppbc);
}
/******************************************************************************

View File

@ -210,9 +210,7 @@ static HRESULT WINAPI ClassMoniker_Save(IMoniker* iface,
hr = IStream_Write(pStm, &This->clsid, sizeof(This->clsid), NULL);
if (FAILED(hr)) return hr;
hr = IStream_Write(pStm, &zero, sizeof(zero), NULL);
return hr;
return IStream_Write(pStm, &zero, sizeof(zero), NULL);
}
/******************************************************************************

View File

@ -655,17 +655,15 @@ static HRESULT DataCacheEntry_LoadData(DataCacheEntry *This)
static HRESULT DataCacheEntry_CreateStream(DataCacheEntry *This,
IStorage *storage, IStream **stream)
{
HRESULT hr;
WCHAR wszName[] = {2,'O','l','e','P','r','e','s',
'0' + (This->stream_number / 100) % 10,
'0' + (This->stream_number / 10) % 10,
'0' + This->stream_number % 10, 0};
/* FIXME: cache the created stream in This? */
hr = IStorage_CreateStream(storage, wszName,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
0, 0, stream);
return hr;
return IStorage_CreateStream(storage, wszName,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
0, 0, stream);
}
static HRESULT DataCacheEntry_Save(DataCacheEntry *This, IStorage *storage,

View File

@ -1146,14 +1146,11 @@ static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
DWORD dwDirection,
IEnumFORMATETC** ppenumFormatEtc)
{
HRESULT hres;
DefaultHandler *This = impl_from_IDataObject(iface);
TRACE("(%p, %x, %p)\n", iface, dwDirection, ppenumFormatEtc);
hres = OleRegEnumFormatEtc(&This->clsid, dwDirection, ppenumFormatEtc);
return hres;
return OleRegEnumFormatEtc(&This->clsid, dwDirection, ppenumFormatEtc);
}
/************************************************************************

View File

@ -421,10 +421,7 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
}
if (!bWriteWide)
{
res=IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
return res;
}
return IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
/* write bytes needed for the filepathW (without 0) + 6 */
bytesW = len*sizeof(WCHAR) + 6;
@ -441,9 +438,7 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty)
if (FAILED(res)) return res;
/* write W string (no 0) */
res=IStream_Write(pStm,filePathW,bytesW,NULL);
return res;
return IStream_Write(pStm,filePathW,bytesW,NULL);
}
/******************************************************************************