ole32: Remove unnecessary assert(This) calls.

This commit is contained in:
Mike McCormack 2006-07-12 18:24:52 +09:00 committed by Alexandre Julliard
parent ac01692523
commit 1a80cb87cb
1 changed files with 1 additions and 17 deletions

View File

@ -245,7 +245,6 @@ static PROPVARIANT *PropertyStorage_FindProperty(PropertyStorage_impl *This,
{ {
PROPVARIANT *ret = NULL; PROPVARIANT *ret = NULL;
assert(This);
dictionary_find(This->propid_to_prop, (void *)propid, (void **)&ret); dictionary_find(This->propid_to_prop, (void *)propid, (void **)&ret);
TRACE("returning %p\n", ret); TRACE("returning %p\n", ret);
return ret; return ret;
@ -258,7 +257,6 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
PROPVARIANT *ret = NULL; PROPVARIANT *ret = NULL;
PROPID propid; PROPID propid;
assert(This);
if (!name) if (!name)
return NULL; return NULL;
if (This->codePage == CP_UNICODE) if (This->codePage == CP_UNICODE)
@ -289,7 +287,6 @@ static LPWSTR PropertyStorage_FindPropertyNameById(PropertyStorage_impl *This,
{ {
LPWSTR ret = NULL; LPWSTR ret = NULL;
assert(This);
dictionary_find(This->propid_to_name, (void *)propid, (void **)&ret); dictionary_find(This->propid_to_name, (void *)propid, (void **)&ret);
TRACE("returning %p\n", ret); TRACE("returning %p\n", ret);
return ret; return ret;
@ -468,7 +465,6 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
HRESULT hr = S_OK; HRESULT hr = S_OK;
PROPVARIANT *prop = PropertyStorage_FindProperty(This, propid); PROPVARIANT *prop = PropertyStorage_FindProperty(This, propid);
assert(This);
assert(propvar); assert(propvar);
if (propvar->vt & VT_BYREF || propvar->vt & VT_ARRAY) if (propvar->vt & VT_BYREF || propvar->vt & VT_ARRAY)
This->format = 1; This->format = 1;
@ -1002,7 +998,6 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
DWORD numEntries, i; DWORD numEntries, i;
HRESULT hr = S_OK; HRESULT hr = S_OK;
assert(This);
assert(This->name_to_propid); assert(This->name_to_propid);
assert(This->propid_to_name); assert(This->propid_to_name);
@ -1272,7 +1267,6 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
ULONG count = 0; ULONG count = 0;
DWORD dictOffset = 0; DWORD dictOffset = 0;
assert(This);
This->dirty = FALSE; This->dirty = FALSE;
This->highestProp = 0; This->highestProp = 0;
hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME); hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
@ -1389,6 +1383,7 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
{ {
PROPVARIANT prop; PROPVARIANT prop;
memset(&prop, 0, sizeof prop);
if (SUCCEEDED(PropertyStorage_ReadProperty(This, &prop, if (SUCCEEDED(PropertyStorage_ReadProperty(This, &prop,
buf + idOffset->dwOffset - sizeof(PROPERTYSECTIONHEADER)))) buf + idOffset->dwOffset - sizeof(PROPERTYSECTIONHEADER))))
{ {
@ -1452,7 +1447,6 @@ end:
static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
PROPERTYSETHEADER *hdr) PROPERTYSETHEADER *hdr)
{ {
assert(This);
assert(hdr); assert(hdr);
StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0, StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0,
PROPSETHDR_BYTEORDER_MAGIC); PROPSETHDR_BYTEORDER_MAGIC);
@ -1465,7 +1459,6 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This,
FORMATIDOFFSET *fmtOffset) FORMATIDOFFSET *fmtOffset)
{ {
assert(This);
assert(fmtOffset); assert(fmtOffset);
StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid);
StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset),
@ -1505,7 +1498,6 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
ULONG count; ULONG count;
assert(key); assert(key);
assert(This);
assert(closure); assert(closure);
StorageUtl_WriteDWord((LPBYTE)&propid, 0, (DWORD)value); StorageUtl_WriteDWord((LPBYTE)&propid, 0, (DWORD)value);
c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count); c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count);
@ -1573,7 +1565,6 @@ static HRESULT PropertyStorage_WriteDictionaryToStream(
DWORD dwTemp; DWORD dwTemp;
struct DictionaryClosure closure; struct DictionaryClosure closure;
assert(This);
assert(sectionOffset); assert(sectionOffset);
/* The dictionary's always the first property written, so seek to its /* The dictionary's always the first property written, so seek to its
@ -1628,7 +1619,6 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
ULONG count; ULONG count;
DWORD dwType, bytesWritten; DWORD dwType, bytesWritten;
assert(This);
assert(var); assert(var);
assert(sectionOffset); assert(sectionOffset);
@ -1789,7 +1779,6 @@ static HRESULT PropertyStorage_WritePropertiesToStream(
{ {
struct PropertyClosure closure; struct PropertyClosure closure;
assert(This);
assert(sectionOffset); assert(sectionOffset);
closure.hr = S_OK; closure.hr = S_OK;
closure.propNum = startingPropNum; closure.propNum = startingPropNum;
@ -1807,7 +1796,6 @@ static HRESULT PropertyStorage_WriteHeadersToStream(PropertyStorage_impl *This)
PROPERTYSETHEADER hdr; PROPERTYSETHEADER hdr;
FORMATIDOFFSET fmtOffset; FORMATIDOFFSET fmtOffset;
assert(This);
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
@ -1845,8 +1833,6 @@ static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *This)
DWORD numProps, prop, sectionOffset, dwTemp; DWORD numProps, prop, sectionOffset, dwTemp;
PROPVARIANT var; PROPVARIANT var;
assert(This);
PropertyStorage_WriteHeadersToStream(This); PropertyStorage_WriteHeadersToStream(This);
/* Count properties. Always at least one property, the code page */ /* Count properties. Always at least one property, the code page */
@ -1933,7 +1919,6 @@ end:
*/ */
static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *This) static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *This)
{ {
assert(This);
dictionary_destroy(This->name_to_propid); dictionary_destroy(This->name_to_propid);
This->name_to_propid = NULL; This->name_to_propid = NULL;
dictionary_destroy(This->propid_to_name); dictionary_destroy(This->propid_to_name);
@ -1946,7 +1931,6 @@ static HRESULT PropertyStorage_CreateDictionaries(PropertyStorage_impl *This)
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
assert(This);
This->name_to_propid = dictionary_create( This->name_to_propid = dictionary_create(
PropertyStorage_PropNameCompare, PropertyStorage_PropNameDestroy, PropertyStorage_PropNameCompare, PropertyStorage_PropNameDestroy,
This); This);