Closed Bug 1409258 Opened 2 years ago Closed 2 years ago

Resolve -Wnarrowing warnings inside dom/plugins

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

>  /builds/worker/workspace/build/src/dom/plugins/ipc/PluginInstanceChild.cpp:3315:21: error: narrowing conversion of '((mozilla::plugins::PluginInstanceChild*)this)->mozilla::plugins::PluginInstanceChild::mWindow._NPWindow::width' from 'uint32_t {aka unsigned int}' to 'int' inside { } [-Werror=narrowing]
>               mWindow.width, mWindow.height,
>               ~~~~~~~~^~~~~
>  /builds/worker/workspace/build/src/dom/plugins/ipc/PluginInstanceChild.cpp:3315:36: error: narrowing conversion of '((mozilla::plugins::PluginInstanceChild*)this)->mozilla::plugins::PluginInstanceChild::mWindow._NPWindow::height' from 'uint32_t {aka unsigned int}' to 'int' inside { } [-Werror=narrowing]
>               mWindow.width, mWindow.height,
>                              ~~~~~~~~^~~~~~
>  /builds/worker/workspace/build/src/dom/plugins/ipc/PluginInstanceChild.cpp:3320:13: error: narrowing conversion of '(LPARAM)(& winpos)' from 'LPARAM {aka long int}' to 'uintptr_t {aka unsigned int}' inside { } [-Werror=narrowing]
>               (LPARAM) &winpos
>               ^~~~~~~~~~~~~~~~




For width and height, it seems like these are initialized from a function or member of type int but stored as uints:
http://searchfox.org/mozilla-central/source/layout/generic/nsPluginFrame.cpp#582
http://searchfox.org/mozilla-central/source/layout/generic/nsPluginFrame.cpp#660

I think I can go through and make them uints, does that sound good?
Flags: needinfo?(jmathies)
You don't want to modify NSWindow but if you want to touch up the conversion seems fine.

http://searchfox.org/mozilla-central/source/dom/plugins/base/npapi.h#514
Flags: needinfo?(jmathies)
Priority: -- → P3
Comment on attachment 8919379 [details]
Bug 1409258 Adjust the definition of NPEvent and resolve uint -> int narrowing in dom/plugins

https://reviewboard.mozilla.org/r/190228/#review195530
Attachment #8919379 - Flags: review?(jmathies) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/73c16ac04291
Adjust the definition of NPEvent and resolve uint -> int narrowing in dom/plugins r=jimm
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/73c16ac04291
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.