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/lower.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'source/slang/lower.cpp') diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp index 674614cd3..e03fd878b 100644 --- a/source/slang/lower.cpp +++ b/source/slang/lower.cpp @@ -80,7 +80,7 @@ struct StructuralTransformStmtVisitor : StructuralTransformVisitorBase , StmtVisitor, RefPtr> { - void transformFields(StatementSyntaxNode* result, StatementSyntaxNode* obj) + void transformFields(StatementSyntaxNode*, StatementSyntaxNode*) { } @@ -457,7 +457,7 @@ struct LoweringVisitor // StatementSyntaxNode* translateStmtRef( - StatementSyntaxNode* stmt) + StatementSyntaxNode*) { throw "unimplemented"; } @@ -666,13 +666,13 @@ struct LoweringVisitor } RefPtr translateSubstitutions( - Substitutions* substitutions) + Substitutions* inSubstitutions) { - if (!substitutions) return nullptr; + if (!inSubstitutions) return nullptr; RefPtr result = new Substitutions(); - result->genericDecl = translateDeclRef(substitutions->genericDecl).As(); - for (auto arg : substitutions->args) + result->genericDecl = translateDeclRef(inSubstitutions->genericDecl).As(); + for (auto arg : inSubstitutions->args) { result->args.Add(translateVal(arg)); } @@ -740,9 +740,8 @@ struct LoweringVisitor } else { - DeclVisitor::dispatch(declBase); + return DeclVisitor::dispatch(declBase); } - } RefPtr lowerDecl( @@ -922,8 +921,8 @@ struct LoweringVisitor // // If this is a global variable (program scope), then add it // to the global scope. - RefPtr parentDecl = decl->ParentDecl; - if (auto parentModuleDecl = parentDecl.As()) + RefPtr pp = decl->ParentDecl; + if (auto parentModuleDecl = pp.As()) { addMember( translateDeclRef(parentModuleDecl), @@ -1138,10 +1137,6 @@ struct LoweringVisitor subscriptExpr->Position = varExpr->Position; subscriptExpr->BaseExpression = varExpr; - // TODO: we need to construct syntax for a loop to initialize - // the array here... - throw "unimplemented"; - // Note that we use the original `varLayout` that was passed in, // since that is the layout that will ultimately need to be // used on the array elements. @@ -1154,6 +1149,9 @@ struct LoweringVisitor varLayout, subscriptExpr); + // TODO: we need to construct syntax for a loop to initialize + // the array here... + throw "unimplemented"; } else if (auto declRefType = varType->As()) { -- cgit v1.2.3