Closed Bug 734306 Opened 8 years ago Closed 8 years ago

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)

Categories

(Core :: Plug-ins, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: Waldo, Assigned: jaas)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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: nobody → joshmoz
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)
I think this probably landed with Bas's async NPAPI implementation.
Attached patch fix v1.0Splinter Review
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+
https://hg.mozilla.org/mozilla-central/rev/de4b5d7ba0e5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.