peiyongz    2003/09/23 11:11:29

  Modified:    c/src/xercesc/internal XSerializeEngine.cpp
  Log:
  Using HashPtr
  
  Revision  Changes    Path
  1.3       +7 -8      xml-xerces/c/src/xercesc/internal/XSerializeEngine.cpp
  
  Index: XSerializeEngine.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSerializeEngine.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XSerializeEngine.cpp      19 Sep 2003 16:04:01 -0000      1.2
  +++ XSerializeEngine.cpp      23 Sep 2003 18:11:29 -0000      1.3
  @@ -57,8 +57,8 @@
   /*
    * $Id$
    * $Log$
  - * Revision 1.2  2003/09/19 16:04:01  peiyongz
  - * Resolve compilation error on 64bit platform (can convert (void* const) to int).
  + * Revision 1.3  2003/09/23 18:11:29  peiyongz
  + * Using HashPtr
    *
    * Revision 1.1  2003/09/18 18:31:24  peiyongz
    * OSU: Object Serialization Utilities
  @@ -74,6 +74,8 @@
   #include <xercesc/internal/XSerializable.hpp>
   #include <xercesc/internal/XProtoType.hpp>
   
  +#include <xercesc/util/HashPtr.hpp>
  +
   XERCES_CPP_NAMESPACE_BEGIN
   
   static const XSerializeEngine::XSerializedObjectId_t fgNullObjectTag  = 0;          
 // indicating null ptrs
  @@ -142,7 +144,7 @@
   ,fBufCur(fBufStart)
   ,fBufEnd(fBufStart+bufSize)
   ,fBufLoadMax(0)
  -,fStorePool( new (fMemoryManager) RefHashTableOf<XSerializedObjectId>(29, true,  
fMemoryManager) )
  +,fStorePool( new (fMemoryManager) RefHashTableOf<XSerializedObjectId>(29, true, new 
HashPtr(), fMemoryManager) )
   ,fLoadPool(0)
   ,fObjectCount(0)
   {
  @@ -182,7 +184,7 @@
       ensureStoring();
       //don't ensurePointer here !!!
   
  -    XSerializedObjectId_t   objIndex;
  +    XSerializedObjectId_t   objIndex = 0;
   
        if (!objectToWrite)  // null pointer
        {
  @@ -625,12 +627,9 @@
   XSerializeEngine::XSerializedObjectId_t 
   XSerializeEngine::lookupStorePool(void* const objToLookup) const
   {
  -    XSerializedObjectId* data = fStorePool->get(objToLookup);
  -
  -    if (!data)
  -        return 0;   //indicating object is not in the StorePool
  -    else
  -        return data->getValue();
  +    //0 indicating object is not in the StorePool
  +    XSerializedObjectId* data = fStorePool->get(objToLookup);   
  +    return (XSerializeEngine::XSerializedObjectId_t) (data ? data->getValue() : 0);
   
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to