GLContextProviderEGL nullptr related build error with vc11

RESOLVED FIXED in mozilla17

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jimm, Assigned: romaxa)

Tracking

Trunk
mozilla17
x86_64
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

3.21 KB, patch
Joe Drew (not getting mail)
: review+
Details | Diff | Splinter Review
(Reporter)

Description

5 years ago
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!)
(Reporter)

Comment 2

5 years ago
Created attachment 645271 [details] [diff] [review]
patch
(Reporter)

Updated

5 years ago
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-
(Reporter)

Comment 4

5 years ago
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. :)
(Reporter)

Comment 6

5 years ago
Created attachment 645410 [details] [diff] [review]
patch

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+
(Reporter)

Comment 8

5 years ago
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
Duplicate of this bug: 777241
(Assignee)

Comment 11

5 years ago
Created attachment 645879 [details] [diff] [review]
Proper fix for nullptr build error
Assignee: nobody → romaxa
Attachment #645410 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #645879 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #645879 - Flags: review? → review?(joe)
Attachment #645879 - Flags: review?(joe) → review+
(Reporter)

Comment 12

5 years ago
(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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.