Closed Bug 279806 Opened 20 years ago Closed 20 years ago

kNameSpaceID_None casts to pointer

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

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?
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
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: