[webkit-changes] cvs commit: JavaScriptCore/kxmlcore HashMapPtrSpec.h

Maciej mjs at opensource.apple.com
Sat Dec 24 14:06:57 PST 2005


mjs         05/12/24 14:06:57

  Modified:    .        ChangeLog
               kxmlcore HashMapPtrSpec.h
  Log:
          Reviewed by Eric.
  
  	- fixed "HashMap does not work with const pointer keys or values"
          http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
  
          * kxmlcore/HashMapPtrSpec.h:
          (KXMLCore::HashMap): In all methods, explicitly cast all pointers
  	to void * before passing to internal implementation. Use C-style
  	casts instead of new-style casts, because the real solution would
          require a combo of reinterpret_cast anc const_cast.
  
  Revision  Changes    Path
  1.926     +14 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.925
  retrieving revision 1.926
  diff -u -r1.925 -r1.926
  --- ChangeLog	23 Dec 2005 08:34:40 -0000	1.925
  +++ ChangeLog	24 Dec 2005 22:06:55 -0000	1.926
  @@ -1,5 +1,19 @@
   2005-12-23  Maciej Stachowiak  <mjs at apple.com>
   
  +        Reviewed by Eric.
  +
  +	- fixed "HashMap does not work with const pointer keys or values"
  +        http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
  +	
  +        * kxmlcore/HashMapPtrSpec.h:
  +        (KXMLCore::HashMap): In all methods, explicitly cast all pointers
  +	to void * before passing to internal implementation. Use C-style
  +	casts instead of new-style casts, because the real solution would
  +        require a combo of reinterpret_cast anc const_cast.
  +
  +
  +2005-12-23  Maciej Stachowiak  <mjs at apple.com>
  +
           - this time for sure
   
           * kxmlcore/RefPtr.h:
  
  
  
  1.4       +14 -14    JavaScriptCore/kxmlcore/HashMapPtrSpec.h
  
  Index: HashMapPtrSpec.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kxmlcore/HashMapPtrSpec.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HashMapPtrSpec.h	23 Dec 2005 01:52:43 -0000	1.3
  +++ HashMapPtrSpec.h	24 Dec 2005 22:06:57 -0000	1.4
  @@ -151,18 +151,18 @@
           const_iterator begin() const { return m_impl.begin(); }
           const_iterator end() const { return m_impl.end(); }
           
  -        iterator find(const KeyType& key) { return m_impl.find(key); }
  -        const_iterator find(const KeyType& key) const { return m_impl.find(key); }
  -        bool contains(const KeyType& key) const { return m_impl.contains(key); }
  -        MappedType get(const KeyType &key) const { return m_impl.get(key); }
  +        iterator find(const KeyType& key) { return m_impl.find((void *)(key)); }
  +        const_iterator find(const KeyType& key) const { return m_impl.find((void *)(key)); }
  +        bool contains(const KeyType& key) const { return m_impl.contains((void *)(key)); }
  +        MappedType get(const KeyType &key) const { return m_impl.get((void *)(key)); }
           
           std::pair<iterator, bool> set(const KeyType &key, const MappedType &mapped) 
  -        { return m_impl.set(key, mapped); }
  +        { return m_impl.set((void *)(key), mapped); }
   
           std::pair<iterator, bool> add(const KeyType &key, const MappedType &mapped) 
  -        { return m_impl.add(key, mapped); }
  +        { return m_impl.add((void *)(key), mapped); }
           
  -        void remove(const KeyType& key) { m_impl.remove(key); }
  +        void remove(const KeyType& key) { m_impl.remove((void *)(key)); }
           void remove(iterator it) { m_impl.remove(it.m_impl); }
           void clear() { m_impl.clear(); }
           
  @@ -197,18 +197,18 @@
           const_iterator begin() const { return m_impl.begin(); }
           const_iterator end() const { return m_impl.end(); }
           
  -        iterator find(const KeyType& key) { return m_impl.find(key); }
  -        const_iterator find(const KeyType& key) const { return m_impl.find(key); }
  -        bool contains(const KeyType& key) const { return m_impl.contains(key); }
  -        MappedType get(const KeyType &key) const { return (MappedType)m_impl.get(key); }
  +        iterator find(const KeyType& key) { return m_impl.find((void *)(key)); }
  +        const_iterator find(const KeyType& key) const { return m_impl.find((void *)(key)); }
  +        bool contains(const KeyType& key) const { return m_impl.contains((void *)(key)); }
  +        MappedType get(const KeyType &key) const { return reinterpret_cast<MappedType>(m_impl.get((void *)(key))); }
           
           std::pair<iterator, bool> set(const KeyType &key, const MappedType &mapped) 
  -        { return m_impl.set(key, mapped); }
  +        { return m_impl.set((void *)(key), (void *)(mapped)); }
   
           std::pair<iterator, bool> add(const KeyType &key, const MappedType &mapped) 
  -        { return m_impl.add(key, mapped); }
  +        { return m_impl.add((void *)(key), (void *)(mapped)); }
           
  -        void remove(const KeyType& key) { m_impl.remove(key); }
  +        void remove(const KeyType& key) { m_impl.remove((void *)(key)); }
           void remove(iterator it) { m_impl.remove(it.m_impl); }
           void clear() { m_impl.clear(); }
           
  
  
  



More information about the webkit-changes mailing list