Closed Bug 299615 Opened 19 years ago Closed 19 years ago

bad use of pointer operators in nsBaseWidget.h

Categories

(Core :: Widget, defect)

defect
Not set
trivial

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jaas, Assigned: jaas)

Details

In nsBaseWidget.h:

NS_IMETHOD GetClientData(void*& aClientData);

I'm not exactly sure what the point of "*&" is, but it looks wrong to me. I
think it needs to be fixed, but if not, please fill me in on why.
There's a bunch of these in widget and gfx; they should probably become "void
**"'s and implementations and callees fixed accordingly.  The gfx stuff will
disappear in a few months time, so maybe not worth doing the change for that,
but worth it for widget.
void*& is a reference to a pointer. It means that the method can return a
pointer as an 'out' param. The advantage of using a reference as an out param is
that it's impossible (or at least hard) for the caller to pass NULL.

This is in nsIWidget, that isn't going to change any time soon.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Thanks for the explanation.
(In reply to comment #2)
> This is in nsIWidget, that isn't going to change any time soon.

Why's that?
(In reply to comment #4)
> (In reply to comment #2)
> > This is in nsIWidget, that isn't going to change any time soon.
> 
> Why's that?

If you want to take on the task of fixing up the widget imlementations and call
callers of GetNativeData(), then feel free  :)  It's just quite a bit of work.
(In reply to comment #5)
> If you want to take on the task of fixing up the widget imlementations and call
> callers of GetNativeData(), then feel free  :)  It's just quite a bit of work.

Ah, yeah, I wasn't sure if there was some ABI reason why we couldn't change it.
 Certainly not worth doing for 1.8, but probably worth it as part of 1.9 --
there will probably need to be some widget changes anyway, so may as well do
some cleanup as well.
You need to log in before you can comment on or make changes to this bug.