From 03de737f0d18526b99b59a1810c7e290b66f4be2 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 6 Jul 2017 11:11:01 -0700 Subject: Fix many warnings-as-errors issues. The code should now compile cleanly with warnings as errors for VS2015 with `W3`. Most of the changes had to do with propagating a real pointer-sized integer type through code that had been using `int`. --- source/slang/type-layout.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/slang/type-layout.cpp') diff --git a/source/slang/type-layout.cpp b/source/slang/type-layout.cpp index bef777ce5..2fcf64226 100644 --- a/source/slang/type-layout.cpp +++ b/source/slang/type-layout.cpp @@ -225,7 +225,7 @@ struct DefaultVaryingLayoutRulesImpl : DefaultLayoutRulesImpl return kind; } - SimpleLayoutInfo GetScalarLayout(BaseType baseType) override + SimpleLayoutInfo GetScalarLayout(BaseType) override { // Assume that all scalars take up one "slot" return SimpleLayoutInfo( @@ -233,7 +233,7 @@ struct DefaultVaryingLayoutRulesImpl : DefaultLayoutRulesImpl 1); } - virtual SimpleLayoutInfo GetScalarLayout(slang::TypeReflection::ScalarType scalarType) + virtual SimpleLayoutInfo GetScalarLayout(slang::TypeReflection::ScalarType) { // Assume that all scalars take up one "slot" return SimpleLayoutInfo( @@ -241,7 +241,7 @@ struct DefaultVaryingLayoutRulesImpl : DefaultLayoutRulesImpl 1); } - SimpleLayoutInfo GetVectorLayout(SimpleLayoutInfo elementInfo, size_t elementCount) override + SimpleLayoutInfo GetVectorLayout(SimpleLayoutInfo, size_t) override { // Vectors take up one slot by default // @@ -276,7 +276,7 @@ struct GLSLSpecializationConstantLayoutRulesImpl : DefaultLayoutRulesImpl return LayoutResourceKind::SpecializationConstant; } - SimpleLayoutInfo GetScalarLayout(BaseType baseType) override + SimpleLayoutInfo GetScalarLayout(BaseType) override { // Assume that all scalars take up one "slot" return SimpleLayoutInfo( @@ -284,7 +284,7 @@ struct GLSLSpecializationConstantLayoutRulesImpl : DefaultLayoutRulesImpl 1); } - virtual SimpleLayoutInfo GetScalarLayout(slang::TypeReflection::ScalarType scalarType) + virtual SimpleLayoutInfo GetScalarLayout(slang::TypeReflection::ScalarType) { // Assume that all scalars take up one "slot" return SimpleLayoutInfo( @@ -292,7 +292,7 @@ struct GLSLSpecializationConstantLayoutRulesImpl : DefaultLayoutRulesImpl 1); } - SimpleLayoutInfo GetVectorLayout(SimpleLayoutInfo elementInfo, size_t elementCount) override + SimpleLayoutInfo GetVectorLayout(SimpleLayoutInfo, size_t elementCount) override { // GLSL doesn't support vectors of specialization constants, // but we will assume that, if supported, they would use one slot per element. @@ -308,7 +308,7 @@ GLSLSpecializationConstantLayoutRulesImpl kGLSLSpecializationConstantLayoutRules struct GLSLObjectLayoutRulesImpl : ObjectLayoutRulesImpl { - virtual SimpleLayoutInfo GetObjectLayout(ShaderParameterKind kind) override + virtual SimpleLayoutInfo GetObjectLayout(ShaderParameterKind) override { // In Vulkan GLSL, pretty much every object is just a descriptor-table slot. // We can refine this method once we support a case where this isn't true. @@ -954,7 +954,7 @@ SimpleLayoutInfo GetLayoutImpl( return GetSimpleLayoutImpl( rules->GetVectorLayout( GetLayout(vecType->elementType.Ptr(), rules), - GetIntVal(vecType->elementCount)), + (size_t) GetIntVal(vecType->elementCount)), type, rules, outTypeLayout); @@ -964,8 +964,8 @@ SimpleLayoutInfo GetLayoutImpl( return GetSimpleLayoutImpl( rules->GetMatrixLayout( GetLayout(matType->getElementType(), rules), - GetIntVal(matType->getRowCount()), - GetIntVal(matType->getColumnCount())), + (size_t) GetIntVal(matType->getRowCount()), + (size_t) GetIntVal(matType->getColumnCount())), type, rules, outTypeLayout); -- cgit v1.2.3