Mike McCormack : ole32: Remove unnecessary assert(This) calls.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 12 14:21:09 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 1a80cb87cb0378fd5341c7db1a55b994df20b6d1
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=1a80cb87cb0378fd5341c7db1a55b994df20b6d1

Author: Mike McCormack <mike at codeweavers.com>
Date:   Wed Jul 12 18:24:52 2006 +0900

ole32: Remove unnecessary assert(This) calls.

---

 dlls/ole32/stg_prop.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

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




More information about the wine-cvs mailing list