kNameSpaceID_None casts to pointer

RESOLVED FIXED in mozilla1.8beta1

Status

()

Core
DOM
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla1.8beta1
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

nodeinfo->Equals(kNameSpaceID_None, nsHTMLAtoms::foo) compiles, becase the
namespace id casts to nsIAtom* and we call the (localname, prefix) version of
the function.

sicking and I poked at this and found a change that keeps at least gcc 3.2 from
casting the namespace to nsIAtom*.  Thoughts on checking this in?
Created attachment 172385 [details] [diff] [review]
Like this, say...
Attachment #172385 - Flags: superreview?(jst)
Attachment #172385 - Flags: review?(jst)
Comment on attachment 172385 [details] [diff] [review]
Like this, say...

Sure, but I wonder if we should just bump the namespace ID's by one and just
not use 0 at all in stead? Unless we think we have code that checks
!namespaceID...
Attachment #172385 - Flags: superreview?(jst)
Attachment #172385 - Flags: superreview+
Attachment #172385 - Flags: review?(jst)
Attachment #172385 - Flags: review+
That's also an option (and I'm willing to bet that we don't have code like
that)....  Either way.
I sort of prefer the approach in the patch, static consts are supposed to be the
c++ replacement for this type of macro anyway (I'm told). Also, there might be
plugins/embedders that are using nsIContent, but I guess they would break on a
regular basis anyway.
I think I prefer not changing the constant values.

Should I change the others to static const PRInt32 as well, or just check this
in as-is?
Either way is fine with me :)

It might be a good idea to include a pointer to this bug in the comment btw.
Though i guess you can always get that info from bonsai.
Assignee: general → bzbarsky
Checked in that patch as-is.

This bug has no more info than the comment in the patch really, so....
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta
You need to log in before you can comment on or make changes to this bug.