mozilla::gl::SharedTextureHandle to nsnull cast error

RESOLVED DUPLICATE of bug 776876

Status

()

RESOLVED DUPLICATE of bug 776876
7 years ago
7 years ago

People

(Reporter: romaxa, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 645661 [details] [diff] [review]
Return 0 instead of nullptr for uintptr value

Compiling on arm EGL provider fail with this error
error: cannot convert 'std::nullptr_t' to 'mozilla::gl::SharedTextureHandle {aka unsigned int}' in return

sounds like we need to cast or return 0 instead of nsnull

SharedTextureHandle - is uintptr_t and nsnull is nullptr.
Attachment #645661 - Flags: review?
(Reporter)

Updated

7 years ago
Attachment #645661 - Flags: review? → review?(ehsan)
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 776876
Comment on attachment 645661 [details] [diff] [review]
Return 0 instead of nullptr for uintptr value

I already vetoed returning 0 :)
Attachment #645661 - Flags: review?(ehsan) → review-
(In reply to Joe Drew (:JOEDREW!) from comment #2)
> Comment on attachment 645661 [details] [diff] [review]
> Return 0 instead of nullptr for uintptr value
> 
> I already vetoed returning 0 :)

I hate to say it but the patch on inbound does exactly this. The reinterpret_cast to SharedTextureHandle failed on b2g/android builds due to in invalid cast:

error: invalid cast from type 'long int' to type 'mozilla::gl::SharedTextureHandle'

I tried a few different iterations, but in the end '0' was the only value that passed on all builds. :/ If you want we can file a bug on finding some other solution or reopen this one as that bug.
(Reporter)

Comment 4

7 years ago
With that version we have this build error, which is not very good
ipc/chromium/src/chrome/common/ipc_message_utils.h: In function 'void IPC::WriteParam(IPC::Message*, const P&) [with P = void*]':
../../ipc/ipdl/_ipdlheaders/mozilla/layers/PImageContainerParent.h:219:9:   instantiated from 'void mozilla::layers::PImageContainerParent::Write(const T&, mozilla::layers::PImageContainerParent::Message*) [with T = void*, mozilla::layers::PImageContainerParent::Message = IPC::Message]'
obj-build-linaro-lgl-dbg/ipc/ipdl/PImageContainerParent.cpp:871:32:   instantiated from here
ipc/chromium/src/chrome/common/ipc_message_utils.h:74:3: error: 'Write' is not a member of 'IPC::ParamTraits<void*>'
ipc/chromium/src/chrome/common/ipc_message_utils.h: In function 'bool IPC::ReadParam(const IPC::Message*, void**, P*) [with P = void*]':
../../ipc/ipdl/_ipdlheaders/mozilla/layers/PImageContainerParent.h:229:49:   instantiated from 'bool mozilla::layers::PImageContainerParent::Read(T*, const Message*, void**) [with T = void*, mozilla::layers::PImageContainerParent::Message = IPC::Message]'
obj-build-linaro-lgl-dbg/ipc/ipdl/PImageContainerParent.cpp:886:52:   instantiated from here
ipc/chromium/src/chrome/common/ipc_message_utils.h:80:41: error: 'Read' is not a member of 'IPC::ParamTraits<void*>'
ipc/chromium/src/chrome/common/ipc_message_utils.h:81:1: error: control reaches end of non-void function [-Werror=return-type]
You need to log in before you can comment on or make changes to this bug.