Bug 109321 - [GTK] Build errors in TextureMapperShaderProgram.cpp when compiling with Clang
Summary: [GTK] Build errors in TextureMapperShaderProgram.cpp when compiling with Clang
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks: 109314
  Show dependency treegraph
 
Reported: 2013-02-08 13:20 PST by Zan Dobersek
Modified: 2013-02-10 02:42 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.57 KB, patch)
2013-02-08 13:37 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (2.28 KB, patch)
2013-02-10 01:14 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2013-02-08 13:20:54 PST
The build fails in TextureMapperShaderProgram.cpp when building with Clang at the following code:
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp#L76

The errors being thrown out:
../../Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:81:9: error: non-constant-expression cannot be narrowed from type 'double' to 'GC3Dfloat' (aka 'float') in initializer list
        matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
        ^~~~~~~~~~~~
../../Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:81:9: note: override this message by inserting an explicit cast
        matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
        ^~~~~~~~~~~~
        static_cast<)C3Dfloat>(
../../Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:81:23: error: non-constant-expression cannot be narrowed from type 'double' to 'GC3Dfloat' (aka 'float') in initializer list
        matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
                      ^~~~~~~~~~~~
../../Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:81:23: note: override this message by inserting an explicit cast
        matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
                      ^~~~~~~~~~~~
                      static_cast<)C3Dfloat>(
(... and so on for the other 14 arguments as well).
Comment 1 Zan Dobersek 2013-02-08 13:37:29 PST
Created attachment 187358 [details]
Patch
Comment 2 Noam Rosenthal 2013-02-09 03:04:07 PST
implicit constructors would also work, without an additional "as" function:
GC3Dfloat(double)
Comment 3 Zan Dobersek 2013-02-10 01:07:06 PST
(In reply to comment #2)
> implicit constructors would also work, without an additional "as" function:
> GC3Dfloat(double)

I guess you meant explicit constructors. They work indeed, I'll upload a patch with those being used.
Comment 4 Zan Dobersek 2013-02-10 01:14:43 PST
Created attachment 187470 [details]
Patch
Comment 5 Zan Dobersek 2013-02-10 02:42:08 PST
Comment on attachment 187470 [details]
Patch

Clearing flags on attachment: 187470

Committed r142392: <http://trac.webkit.org/changeset/142392>
Comment 6 Zan Dobersek 2013-02-10 02:42:18 PST
All reviewed patches have been landed.  Closing bug.