Closed Bug 776876 Opened 12 years ago Closed 12 years ago

GLContextProviderEGL nullptr related build error with vc11

Categories

(Core :: Graphics, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jimm, Assigned: romaxa)

References

Details

Attachments

(1 file, 2 obsolete files)

GLContextProviderEGL.cpp
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(891) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(894) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(906) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(920) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(934) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(941) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
f:/Mozilla/firefox/elm/gfx/gl/GLContextProviderEGL.cpp(948) : error C2440: 'return' : cannot convert from 'nullptr' to 'mozilla::gl::SharedTextureHandle'
        A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
make[4]: *** [GLContextProviderEGL.obj] Error 2
It looks like SharedTextureHandle is a typedef for uintptr_t.  The simple workaround would be to change "nsnull" in all these places to "0".  Alternatively, SharedTextureHandle could be redefined -- I'm puzzled as to why it should be uintptr_t instead of void* or such.  (Actually, I'm not clear what uintptr_t is actually useful for at all!)
Attached patch patch (obsolete) — Splinter Review
Attachment #645271 - Flags: review?(bjacob)
Comment on attachment 645271 [details] [diff] [review]
patch

Change the typedef instead - I'm allergic to 0s!
Attachment #645271 - Flags: review?(bjacob) → review-
There are two ways to do this. Changing SharedTextureHandle to void* works, but for me it is less clear than uintptr_t. If we keep uintptr_t, we can change the return values to reinterpret_cast<uintptr_t>(nsnull), which will ultimately get mass changed to reinterpret_cast<uintptr_t>(nullptr).

I'm fine with either, but I like the second solution better.

Joe, preference?
Much prefer the first, because it lets us just return nsnull. But listen to your heart on this. :)
Attached patch patch (obsolete) — Splinter Review
void* it is!
Attachment #645271 - Attachment is obsolete: true
Attachment #645410 - Flags: review?(joe)
Comment on attachment 645410 [details] [diff] [review]
patch

hooray
Attachment #645410 - Flags: review?(joe) → review+
This blew up on inbound in ipc code - 

error: no member named 'Write' in 'IPC::ParamTraits<void *>'

https://tbpl.mozilla.org/php/getParsedLog.php?id=13813311&tree=Mozilla-Inbound&full=1

So me thinks we need to go with option two.
sadface
Assignee: nobody → romaxa
Attachment #645410 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #645879 - Flags: review?
Attachment #645879 - Flags: review? → review?(joe)
Attachment #645879 - Flags: review?(joe) → review+
(In reply to Oleg Romashin (:romaxa) from comment #11)
> Created attachment 645879 [details] [diff] [review]
> Proper fix for nullptr build error

This patch is already on inbound, it landed this morning.

https://hg.mozilla.org/integration/mozilla-inbound/rev/b00c1e7289da
https://hg.mozilla.org/mozilla-central/rev/b00c1e7289da
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: