The default bug view has changed. See this FAQ.

nsContentEventHandler.cpp:867: warning: unused variable 'pEventWidget'

RESOLVED FIXED in mozilla6

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: Ms2ger)

Tracking

Trunk
mozilla6
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning], URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Filing bug on this warning:
> nsContentEventHandler.cpp:867: warning: unused variable 'pEventWidget'

Code in question (added in bug 627649):
> 856   if (contentUnderMouse) {
[...]
> 867     nsIWidget* pEventWidget = aEvent->widget.get();
> 868   }

The variable is created right at the end of an "if" check, and it immediately goes out of scope without ever being used:

I'm assuming line 867 can just be removed entirely. smichaud, is that correct?
(Reporter)

Comment 1

6 years ago
Meant to link to source in MXR:
http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsContentEventHandler.cpp#867
and cset that added this:
http://hg.mozilla.org/mozilla-central/diff/75082063f8e6/content/events/src/nsContentEventHandler.cpp#l1.68
(Reporter)

Comment 2

6 years ago
...and meant to CC smichaud for an answer to the end of comment 0.
> I'm assuming line 867 can just be removed entirely. smichaud, is
> that correct?

Yes.

It's something left over from my debug build, which I forgot to
remove.

Thanks for catching this, and sorry for the confusion.
(Assignee)

Comment 4

6 years ago
Created attachment 526082 [details] [diff] [review]
Patch v1

And I even had a patch for it!
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
Attachment #526082 - Flags: review?
(Assignee)

Updated

6 years ago
Attachment #526082 - Flags: review? → review?(smichaud)
Comment on attachment 526082 [details] [diff] [review]
Patch v1

Looks good to me :-)
Attachment #526082 - Flags: review?(smichaud) → review+
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/mozilla-central/rev/400353278933
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.