nsNPAPIPluginInstance.cpp:1491:10: warning: implicit conversion from 'nsresult' (aka 'unsigned int') to 'NPError' (aka 'short') changes value from 2147500037 to 16389 (also line 1500)

RESOLVED FIXED in mozilla13

Status

()

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Waldo, Assigned: jaas)

Tracking

(Blocks: 1 bug)

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
NPError
nsNPAPIPluginInstance::InitAsyncSurface(NPSize *size, NPImageFormat format,
                                        void *initData, NPAsyncSurface *surface)
{
  if (mOwner)
    return mOwner->InitAsyncSurface(size, format, initData, surface);

  return NS_ERROR_FAILURE;
}

NPError
nsNPAPIPluginInstance::FinalizeAsyncSurface(NPAsyncSurface *surface)
{
  if (mOwner)
    return mOwner->FinalizeAsyncSurface(surface);

  return NS_ERROR_FAILURE;
}

We're defining a method that returns NPError, then returning an nsresult from it.  Clearly a bug, no idea what the consequences are.  (And <3 clang for pointing it out so nicely, including with the truncated value parts.)
(Assignee)

Updated

7 years ago
Assignee: nobody → joshmoz
(Reporter)

Updated

7 years ago
Summary: nsNPAPIPluginInstance.cpp:1491:10: warning: implicit conversion from 'nsresult' (aka 'unsigned int') to 'NPError' (aka 'short') changes value from 2147500037 to 16389 (also line 1500 → nsNPAPIPluginInstance.cpp:1491:10: warning: implicit conversion from 'nsresult' (aka 'unsigned int') to 'NPError' (aka 'short') changes value from 2147500037 to 16389 (also line 1500)
(Assignee)

Comment 1

7 years ago
I think this probably landed with Bas's async NPAPI implementation.
(Assignee)

Comment 2

7 years ago
Created attachment 604454 [details] [diff] [review]
fix v1.0
Attachment #604454 - Flags: review?(bas.schouten)
Comment on attachment 604454 [details] [diff] [review]
fix v1.0

Review of attachment 604454 [details] [diff] [review]:
-----------------------------------------------------------------

I doubt there's significant consequences! But this is a good change!
Attachment #604454 - Flags: review?(bas.schouten) → review+
(Assignee)

Comment 4

7 years ago
pushed to mozilla-inbound

http://hg.mozilla.org/integration/mozilla-inbound/rev/de4b5d7ba0e5
https://hg.mozilla.org/mozilla-central/rev/de4b5d7ba0e5
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.