Last Comment Bug 776876 - GLContextProviderEGL nullptr related build error with vc11
: GLContextProviderEGL nullptr related build error with vc11
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: mozilla17
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
: 777241 (view as bug list)
Depends on:
Blocks: VC11 626472
  Show dependency treegraph
 
Reported: 2012-07-24 04:55 PDT by Jim Mathies [:jimm]
Modified: 2012-07-26 05:14 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (3.01 KB, patch)
2012-07-24 06:19 PDT, Jim Mathies [:jimm]
joe: review-
Details | Diff | Review
patch (551 bytes, patch)
2012-07-24 11:51 PDT, Jim Mathies [:jimm]
joe: review+
Details | Diff | Review
Proper fix for nullptr build error (3.21 KB, patch)
2012-07-25 14:07 PDT, Oleg Romashin (:romaxa)
joe: review+
Details | Diff | Review

Description Jim Mathies [:jimm] 2012-07-24 04:55:03 PDT
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
Comment 1 :Aryeh Gregor (away until August 15) 2012-07-24 05:03:31 PDT
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!)
Comment 2 Jim Mathies [:jimm] 2012-07-24 06:19:26 PDT
Created attachment 645271 [details] [diff] [review]
patch
Comment 3 Joe Drew (not getting mail) 2012-07-24 11:04:37 PDT
Comment on attachment 645271 [details] [diff] [review]
patch

Change the typedef instead - I'm allergic to 0s!
Comment 4 Jim Mathies [:jimm] 2012-07-24 11:34:23 PDT
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?
Comment 5 Joe Drew (not getting mail) 2012-07-24 11:45:00 PDT
Much prefer the first, because it lets us just return nsnull. But listen to your heart on this. :)
Comment 6 Jim Mathies [:jimm] 2012-07-24 11:51:54 PDT
Created attachment 645410 [details] [diff] [review]
patch

void* it is!
Comment 7 Joe Drew (not getting mail) 2012-07-24 11:53:30 PDT
Comment on attachment 645410 [details] [diff] [review]
patch

hooray
Comment 8 Jim Mathies [:jimm] 2012-07-24 13:39:42 PDT
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.
Comment 9 Joe Drew (not getting mail) 2012-07-24 13:53:50 PDT
sadface
Comment 10 Joe Drew (not getting mail) 2012-07-25 10:19:44 PDT
*** Bug 777241 has been marked as a duplicate of this bug. ***
Comment 11 Oleg Romashin (:romaxa) 2012-07-25 14:07:04 PDT
Created attachment 645879 [details] [diff] [review]
Proper fix for nullptr build error
Comment 12 Jim Mathies [:jimm] 2012-07-25 14:49:07 PDT
(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
Comment 13 Ed Morley [:emorley] 2012-07-26 05:14:05 PDT
https://hg.mozilla.org/mozilla-central/rev/b00c1e7289da

Note You need to log in before you can comment on or make changes to this bug.