pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox3 Replace the hack in patch-el with the pro...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b5e4cd908bc3
branches:  trunk
changeset: 553873:b5e4cd908bc3
user:      martin <martin%pkgsrc.org@localhost>
date:      Mon Feb 02 09:28:56 2009 +0000

description:
Replace the hack in patch-el with the proposed real solution from upstream.

diffstat:

 www/firefox3/distinfo         |    4 +-
 www/firefox3/patches/patch-el |  239 ++++++++++++++++++++++++++++++++++++-----
 2 files changed, 212 insertions(+), 31 deletions(-)

diffs (268 lines):

diff -r 676d2b8fff89 -r b5e4cd908bc3 www/firefox3/distinfo
--- a/www/firefox3/distinfo     Mon Feb 02 06:35:44 2009 +0000
+++ b/www/firefox3/distinfo     Mon Feb 02 09:28:56 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2009/02/01 13:03:58 martin Exp $
+$NetBSD: distinfo,v 1.14 2009/02/02 09:28:56 martin Exp $
 
 SHA1 (firefox-3.0.5-source.tar.bz2) = f934e073efaad3d4dde847c8491fa9529564d5d2
 RMD160 (firefox-3.0.5-source.tar.bz2) = ec6e7eab65649c5c79587a5a8ffb9b6b386b5a18
@@ -40,7 +40,7 @@
 SHA1 (patch-ei) = 4484d57e19e39ef86760716d5886ebf2a3e69f63
 SHA1 (patch-ej) = 9b9c708483399fa89c6bf5bdc15e79b31793c89d
 SHA1 (patch-ek) = b94debcf16ba6f0dccc0a812b5e5fa38a150c413
-SHA1 (patch-el) = 126d7acb14e34939782301c6ed204a10448d91b2
+SHA1 (patch-el) = 8a1586e4ebb76f584dc7b1cbc19f0c389ea206f7
 SHA1 (patch-wc) = 2de8665ed6c23c26566ca6d50165c0cf413a753d
 SHA1 (patch-wd) = fc5c3103ae6f2a2eccc01911a8207f3ca614008b
 SHA1 (patch-we) = f7fecce05454e9794ff7a4e7789031a5ef49c42d
diff -r 676d2b8fff89 -r b5e4cd908bc3 www/firefox3/patches/patch-el
--- a/www/firefox3/patches/patch-el     Mon Feb 02 06:35:44 2009 +0000
+++ b/www/firefox3/patches/patch-el     Mon Feb 02 09:28:56 2009 +0000
@@ -1,36 +1,217 @@
-$NetBSD: patch-el,v 1.1 2009/02/01 13:03:58 martin Exp $
+$NetBSD: patch-el,v 1.2 2009/02/02 09:28:56 martin Exp $
 
-# hack to solve upstream bug report
-#   https://bugzilla.mozilla.org/show_bug.cgi?id=476345
-# untill something better gets commited upstream.
-
+# Ensure correct alignment for nsCSSValue objects inside nsCSSValue::Array.
+#  (Bug 476345)
 
 --- layout/style/nsCSSValue.h.orig     2008-07-02 00:51:43.000000000 +0200
-+++ layout/style/nsCSSValue.h  2009-02-01 12:00:17.000000000 +0100
-@@ -342,18 +342,23 @@ public:
-     PRUint16 mRefCnt;
-     PRUint16 mCount;
- 
-+    static size_t alignSize(size_t aSelfSize) {
-+      if (aSelfSize < sizeof(void*)) return sizeof (void*);
-+      return aSelfSize;
-+    }
-+
-     void* operator new(size_t aSelfSize, PRUint16 aItemCount) CPP_THROW_NEW {
++++ layout/style/nsCSSValue.h  2009-02-01 21:43:29.000000000 +0100
+@@ -286,104 +286,7 @@
+   // failure.
+   static nsStringBuffer* BufferFromString(const nsString& aValue);
+   
+-  struct Array {
+-
+-    // return |Array| with reference count of zero
+-    static Array* Create(PRUint16 aItemCount) {
+-      return new (aItemCount) Array(aItemCount);
+-    }
+-
+-    nsCSSValue& operator[](PRUint16 aIndex) {
+-      NS_ASSERTION(aIndex < mCount, "out of range");
+-      return *(First() + aIndex);
+-    }
+-
+-    const nsCSSValue& operator[](PRUint16 aIndex) const {
+-      NS_ASSERTION(aIndex < mCount, "out of range");
+-      return *(First() + aIndex);
+-    }
+-
+-    nsCSSValue& Item(PRUint16 aIndex) { return (*this)[aIndex]; }
+-    const nsCSSValue& Item(PRUint16 aIndex) const { return (*this)[aIndex]; }
+-
+-    PRUint16 Count() const { return mCount; }
+-
+-    PRBool operator==(const Array& aOther) const
+-    {
+-      if (mCount != aOther.mCount)
+-        return PR_FALSE;
+-      for (PRUint16 i = 0; i < mCount; ++i)
+-        if ((*this)[i] != aOther[i])
+-          return PR_FALSE;
+-      return PR_TRUE;
+-    }
+-
+-    void AddRef() {
+-      if (mRefCnt == PR_UINT16_MAX) {
+-        NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
+-        return;
+-      }
+-      ++mRefCnt;
+-      NS_LOG_ADDREF(this, mRefCnt, "nsCSSValue::Array", sizeof(*this));
+-    }
+-    void Release() {
+-      if (mRefCnt == PR_UINT16_MAX) {
+-        NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
+-        return;
+-      }
+-      --mRefCnt;
+-      NS_LOG_RELEASE(this, mRefCnt, "nsCSSValue::Array");
+-      if (mRefCnt == 0)
+-        delete this;
+-    }
+-
+-  private:
+-
+-    PRUint16 mRefCnt;
+-    PRUint16 mCount;
+-
+-    void* operator new(size_t aSelfSize, PRUint16 aItemCount) CPP_THROW_NEW {
 -      return ::operator new(aSelfSize + sizeof(nsCSSValue)*aItemCount);
-+      return ::operator new(alignSize(aSelfSize) + sizeof(nsCSSValue)*aItemCount);
-     }
- 
-     void operator delete(void* aPtr) { ::operator delete(aPtr); }
- 
-     nsCSSValue* First() {
+-    }
+-
+-    void operator delete(void* aPtr) { ::operator delete(aPtr); }
+-
+-    nsCSSValue* First() {
 -      return (nsCSSValue*) (((char*)this) + sizeof(*this));
-+      return (nsCSSValue*) (((char*)this) + alignSize(sizeof(*this)));
-     }
- 
-     const nsCSSValue* First() const {
+-    }
+-
+-    const nsCSSValue* First() const {
 -      return (const nsCSSValue*) (((const char*)this) + sizeof(*this));
-+      return (const nsCSSValue*) (((const char*)this) + alignSize(sizeof(*this)));
-     }
+-    }
+-
+-#define CSSVALUE_LIST_FOR_VALUES(var)                                         \
+-  for (nsCSSValue *var = First(), *var##_end = var + mCount;                  \
+-       var != var##_end; ++var)
+-
+-    Array(PRUint16 aItemCount)
+-      : mRefCnt(0)
+-      , mCount(aItemCount)
+-    {
+-      MOZ_COUNT_CTOR(nsCSSValue::Array);
+-      CSSVALUE_LIST_FOR_VALUES(val) {
+-        new (val) nsCSSValue();
+-      }
+-    }
+-
+-    ~Array()
+-    {
+-      MOZ_COUNT_DTOR(nsCSSValue::Array);
+-      CSSVALUE_LIST_FOR_VALUES(val) {
+-        val->~nsCSSValue();
+-      }
+-    }
+-
+-#undef CSSVALUE_LIST_FOR_VALUES
+-
+-  private:
+-    Array(const Array& aOther); // not to be implemented
+-  };
+-
++  struct Array;
+   struct URL {
+     // Methods are not inline because using an nsIPrincipal means requiring
+     // caps, which leads to REQUIRES hell, since this header is included all
+@@ -454,5 +357,102 @@
+   }         mValue;
+ };
  
- #define CSSVALUE_LIST_FOR_VALUES(var)                                         \
+-#endif /* nsCSSValue_h___ */
++struct nsCSSValue::Array {
++
++  // return |Array| with reference count of zero
++  static Array* Create(PRUint16 aItemCount) {
++    return new (aItemCount) Array(aItemCount);
++  }
++
++  nsCSSValue& operator[](PRUint16 aIndex) {
++    NS_ASSERTION(aIndex < mCount, "out of range");
++    return mArray[aIndex];
++  }
++
++  const nsCSSValue& operator[](PRUint16 aIndex) const {
++    NS_ASSERTION(aIndex < mCount, "out of range");
++    return mArray[aIndex];
++  }
++
++  nsCSSValue& Item(PRUint16 aIndex) { return (*this)[aIndex]; }
++  const nsCSSValue& Item(PRUint16 aIndex) const { return (*this)[aIndex]; }
++
++  PRUint16 Count() const { return mCount; }
++
++  PRBool operator==(const Array& aOther) const
++  {
++    if (mCount != aOther.mCount)
++      return PR_FALSE;
++    for (PRUint16 i = 0; i < mCount; ++i)
++      if ((*this)[i] != aOther[i])
++        return PR_FALSE;
++    return PR_TRUE;
++  }
++
++  void AddRef() {
++    if (mRefCnt == PR_UINT16_MAX) {
++      NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
++      return;
++    }
++    ++mRefCnt;
++    NS_LOG_ADDREF(this, mRefCnt, "nsCSSValue::Array", sizeof(*this));
++  }
++  void Release() {
++    if (mRefCnt == PR_UINT16_MAX) {
++      NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
++      return;
++    }
++    --mRefCnt;
++    NS_LOG_RELEASE(this, mRefCnt, "nsCSSValue::Array");
++    if (mRefCnt == 0)
++      delete this;
++  }
++
++private:
++
++  PRUint16 mRefCnt;
++  const PRUint16 mCount;
++  // This must be the last sub-object, since we extend this array to
++  // be of size mCount; it needs to be a sub-object so it gets proper
++  // alignment.
++  nsCSSValue mArray[1];
+ 
++  void* operator new(size_t aSelfSize, PRUint16 aItemCount) CPP_THROW_NEW {
++    return ::operator new(aSelfSize + sizeof(nsCSSValue) * (aItemCount - 1));
++  }
++
++  void operator delete(void* aPtr) { ::operator delete(aPtr); }
++
++  nsCSSValue* First() { return mArray; }
++
++  const nsCSSValue* First() const { return mArray; }
++
++#define CSSVALUE_LIST_FOR_EXTRA_VALUES(var)                                   \
++for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount;          \
++     var != var##_end; ++var)
++
++  Array(PRUint16 aItemCount)
++    : mRefCnt(0)
++    , mCount(aItemCount)
++  {
++    MOZ_COUNT_CTOR(nsCSSValue::Array);
++    CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
++      new (val) nsCSSValue();
++    }
++  }
++
++  ~Array()
++  {
++    MOZ_COUNT_DTOR(nsCSSValue::Array);
++    CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
++      val->~nsCSSValue();
++    }
++  }
++
++#undef CSSVALUE_LIST_FOR_VALUES
++
++private:
++  Array(const Array& aOther); // not to be implemented
++};
++
++#endif /* nsCSSValue_h___ */



Home | Main Index | Thread Index | Old Index