ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

ShaderLang.cpp does not compile with -Wshorten-64-to-32 #407

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile ANGLE with clang with -Wshorten-64-to-32 warning enabled.

What is the expected output? What do you see instead?
Expected no warnings.  Got warnings.

What version of the product are you using? On what operating system?
ANGLE r1641 merged into the WebKit project.

Please provide any additional information below.

Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp:69:27: error: implicit 
conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' 
[-Werror,-Wshorten-64-to-32]
    if (length) *length = varInfo.name.size();
                        ~ ^~~~~~~~~~~~~~~~~~~
Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp:225:19: error: implicit 
conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' 
[-Werror,-Wshorten-64-to-32]
        *params = compiler->getUniforms().size();
                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp:238:19: error: implicit 
conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' 
[-Werror,-Wshorten-64-to-32]
        *params = compiler->getAttribs().size();
                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp:269:19: error: implicit 
conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' 
[-Werror,-Wshorten-64-to-32]
        *params = compiler->getNameMap().size();
                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

The first issue is related to the 'length' parameter of the getVariableInfo() 
static method.

The last three issues are related to the 'params' parameter of the ShGetInfo() 
method (which is really a parameter count).

Original issue reported on code.google.com by ddkilzer@gmail.com on 27 Jan 2013 at 5:25

GoogleCodeExporter commented 9 years ago

Original comment by kbr@chromium.org on 7 Feb 2013 at 1:14

GoogleCodeExporter commented 9 years ago

Original comment by kbr@chromium.org on 7 Feb 2013 at 1:31

GoogleCodeExporter commented 9 years ago
Fixed in https://code.google.com/p/angleproject/source/detail?r=1826 .

Original comment by kbr@chromium.org on 12 Feb 2013 at 3:11