<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>5706</bug_id>
          
          <creation_ts>2005-11-10 20:13:26 -0800</creation_ts>
          <short_desc>Sharedptr dependency can be removed</short_desc>
          <delta_ts>2005-12-19 14:10:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="George Staikos">staikos</reporter>
          <assigned_to name="Maciej Stachowiak">mjs</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>23913</commentid>
    <comment_count>0</comment_count>
    <who name="George Staikos">staikos</who>
    <bug_when>2005-11-10 20:13:26 -0800</bug_when>
    <thetext>SharedPtr doesn&apos;t compile on its own.  It would need includes for NULL.  This  
causes failures in some configurations.  A better solution in my opinion is to  
change NULL to 0: 
 
 @@ -29,7 +29,7 @@ 
     template &lt;class T&gt; class SharedPtr 
     { 
     public: 
-        SharedPtr() : m_ptr(NULL) {} 
+        SharedPtr() : m_ptr(0) {} 
         SharedPtr(T *ptr) : m_ptr(ptr) { if (ptr) ptr-&gt;ref(); } 
         SharedPtr(const SharedPtr &amp;o) : m_ptr(o.m_ptr) { if (T *ptr = m_ptr) 
ptr-&gt;ref(); } 
         ~SharedPtr() { if (T *ptr = m_ptr) ptr-&gt;deref(); } 
@@ -37,11 +37,11 @@ 
         template &lt;class U&gt; SharedPtr(const SharedPtr&lt;U&gt; &amp;o) : m_ptr(o.get()) 
{ if (T *ptr = m_ptr) ptr-&gt;ref(); } 
          
         // FIXME: Deprecate in favor of operators below, then remove? 
-        bool isNull() const { return m_ptr == NULL; } 
-        bool notNull() const { return m_ptr != NULL; } 
+        bool isNull() const { return m_ptr == 0; } 
+        bool notNull() const { return m_ptr != 0; } 
          
         // FIXME: Deprecate in favor of operator=, then remove? 
-        void reset() { if (T *ptr = m_ptr) ptr-&gt;deref(); m_ptr = NULL; } 
+        void reset() { if (T *ptr = m_ptr) ptr-&gt;deref(); m_ptr = 0; } 
         void reset(T *o) { if (o) o-&gt;ref(); if (T *ptr = m_ptr) ptr-&gt;deref(); 
m_ptr = o; } 
          
         T *get() const { return m_ptr; } 
@@ -49,8 +49,8 @@ 
         T &amp;operator*() const { return *m_ptr; } 
         T *operator-&gt;() const { return m_ptr; } 
          
-        bool operator!() const { return m_ptr == NULL; } 
-        operator bool() const { return m_ptr != NULL; } 
+        bool operator!() const { return m_ptr == 0; } 
+        operator bool() const { return m_ptr != 0; } 
          
         SharedPtr &amp;operator=(const SharedPtr &amp;); 
         SharedPtr &amp;operator=(T *);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26180</commentid>
    <comment_count>1</comment_count>
      <attachid>5151</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-12-19 06:31:23 -0800</bug_when>
    <thetext>Created attachment 5151
Remove NULL from RefPtr and PassRefPtr</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26182</commentid>
    <comment_count>2</comment_count>
      <attachid>5151</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-12-19 08:49:28 -0800</bug_when>
    <thetext>Comment on attachment 5151
Remove NULL from RefPtr and PassRefPtr

Good idea. I had put this in my local copy already.

Although for operator! I think that !m_ptr is even better than m_ptr == 0.

r=me</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5151</attachid>
            <date>2005-12-19 06:31:23 -0800</date>
            <delta_ts>2005-12-19 08:49:28 -0800</delta_ts>
            <desc>Remove NULL from RefPtr and PassRefPtr</desc>
            <filename>NoNULLPatch.txt</filename>
            <type>text/plain</type>
            <size>1917</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFBhc3NSZWZQdHIuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3ZzL3Jvb3QvSmF2YVNj
cmlwdENvcmUva3htbGNvcmUvUGFzc1JlZlB0ci5oLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjMK
ZGlmZiAtcCAtdSAtcjEuMyBQYXNzUmVmUHRyLmgKLS0tIFBhc3NSZWZQdHIuaAk4IERlYyAyMDA1
IDE4OjE5OjI4IC0wMDAwCTEuMworKysgUGFzc1JlZlB0ci5oCTE5IERlYyAyMDA1IDE0OjM3OjMx
IC0wMDAwCkBAIC00MSw3ICs0MSw3IEBAIG5hbWVzcGFjZSBLWE1MQ29yZSB7CiAgICAgY2xhc3Mg
UGFzc1JlZlB0cgogICAgIHsKICAgICBwdWJsaWM6Ci0gICAgICAgIFBhc3NSZWZQdHIoKSA6IG1f
cHRyKE5VTEwpIHt9CisgICAgICAgIFBhc3NSZWZQdHIoKSA6IG1fcHRyKDApIHt9CiAgICAgICAg
IFBhc3NSZWZQdHIoVCAqcHRyKSA6IG1fcHRyKHB0cikgeyBpZiAocHRyKSBwdHItPnJlZigpOyB9
CiAgICAgICAgIFBhc3NSZWZQdHIoY29uc3QgUmVmUHRyPFQ+JiBvKSA6IG1fcHRyKG8uZ2V0KCkp
IHsgaWYgKFQgKnB0ciA9IG1fcHRyKSBwdHItPnJlZigpOyB9Ci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wKSB7
fQogICAgICAgICBSZWZQdHIoVCAqcHRyKSA6IG1fcHRyKHB0cikgeyBpZiAocHRyKSBwdHItPnJl
ZigpOyB9CiAgICAgICAgIFJlZlB0cihjb25zdCBSZWZQdHImIG8pIDogbV9wdHIoby5tX3B0cikg
eyBpZiAoVCAqcHRyID0gbV9wdHIpIHB0ci0+cmVmKCk7IH0KIApAQCAtNDQsNyArNDQsNyBAQCBu
YW1lc3BhY2UgS1hNTENvcmUgewogICAgICAgICBUJiBvcGVyYXRvciooKSBjb25zdCB7IHJldHVy
biAqbV9wdHI7IH0KICAgICAgICAgVCAqb3BlcmF0b3ItPigpIGNvbnN0IHsgcmV0dXJuIG1fcHRy
OyB9CiAgICAgICAgIAotICAgICAgICBib29sIG9wZXJhdG9yISgpIGNvbnN0IHsgcmV0dXJuIG1f
cHRyID09IE5VTEw7IH0KKyAgICAgICAgYm9vbCBvcGVyYXRvciEoKSBjb25zdCB7IHJldHVybiBt
X3B0ciA9PSAwOyB9CiAKICAgICAKICAgICAgICAgLy8gdGhpcyB0eXBlIGNvbnZlcnNpb24gb3Bl
cmF0b3IgYWxsb3dzIGltcGxpY2l0IGNvbnZlcnNpb24gdG8K
</data>
<flag name="review"
          id="1039"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>