From ad625281d044ba6261a4fa4a5d099046bac3a666 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Fri, 2 Apr 1999 18:51:28 +0000 Subject: [PATCH] initialize bitfields through a union to keep purify happy --- content/html/style/src/nsHTMLStyleSheet.cpp | 12 ++++++++---- layout/html/style/src/nsHTMLStyleSheet.cpp | 12 ++++++++---- layout/style/nsHTMLStyleSheet.cpp | 12 ++++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/content/html/style/src/nsHTMLStyleSheet.cpp b/content/html/style/src/nsHTMLStyleSheet.cpp index 4e0c42ec5a1c..d6e7b7ae57bc 100644 --- a/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/content/html/style/src/nsHTMLStyleSheet.cpp @@ -147,8 +147,13 @@ private: public: nsMapAttributesFunc mMapFunc; nsIHTMLAttributes* mAttributes; - PRUint32 mHashSet: 1; - PRUint32 mHashCode: 31; + union { + struct { + PRUint32 mHashSet: 1; + PRUint32 mHashCode: 31; + }; + PRUint32 mBitfiledInitializer; // this is a hack to allow initialization without pruify complaining about a UMR + }; }; AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAttributes) @@ -156,8 +161,7 @@ AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAtt mAttributes(aAttributes) { NS_ADDREF(mAttributes); - mHashSet = 0; - mHashCode = 0; + mBitfiledInitializer = 0; } AttributeKey::~AttributeKey(void) diff --git a/layout/html/style/src/nsHTMLStyleSheet.cpp b/layout/html/style/src/nsHTMLStyleSheet.cpp index 4e0c42ec5a1c..d6e7b7ae57bc 100644 --- a/layout/html/style/src/nsHTMLStyleSheet.cpp +++ b/layout/html/style/src/nsHTMLStyleSheet.cpp @@ -147,8 +147,13 @@ private: public: nsMapAttributesFunc mMapFunc; nsIHTMLAttributes* mAttributes; - PRUint32 mHashSet: 1; - PRUint32 mHashCode: 31; + union { + struct { + PRUint32 mHashSet: 1; + PRUint32 mHashCode: 31; + }; + PRUint32 mBitfiledInitializer; // this is a hack to allow initialization without pruify complaining about a UMR + }; }; AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAttributes) @@ -156,8 +161,7 @@ AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAtt mAttributes(aAttributes) { NS_ADDREF(mAttributes); - mHashSet = 0; - mHashCode = 0; + mBitfiledInitializer = 0; } AttributeKey::~AttributeKey(void) diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index 4e0c42ec5a1c..d6e7b7ae57bc 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -147,8 +147,13 @@ private: public: nsMapAttributesFunc mMapFunc; nsIHTMLAttributes* mAttributes; - PRUint32 mHashSet: 1; - PRUint32 mHashCode: 31; + union { + struct { + PRUint32 mHashSet: 1; + PRUint32 mHashCode: 31; + }; + PRUint32 mBitfiledInitializer; // this is a hack to allow initialization without pruify complaining about a UMR + }; }; AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAttributes) @@ -156,8 +161,7 @@ AttributeKey::AttributeKey(nsMapAttributesFunc aMapFunc, nsIHTMLAttributes* aAtt mAttributes(aAttributes) { NS_ADDREF(mAttributes); - mHashSet = 0; - mHashCode = 0; + mBitfiledInitializer = 0; } AttributeKey::~AttributeKey(void)