diff --git a/src/ast/import.cc b/src/ast/import.cc index aa7aff8a77..536a90a142 100644 --- a/src/ast/import.cc +++ b/src/ast/import.cc @@ -14,6 +14,8 @@ #include "src/ast/import.h" +#include + namespace tint { namespace ast { diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index 903f9b17c3..1eec4e2dc7 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -18,6 +18,7 @@ #include #include +#include #include namespace tint { diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 61aeeab94d..5916e707cc 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -808,7 +808,7 @@ ast::type::Type* ParserImpl::type_decl_pointer(Token t) { ast::type::Type* ParserImpl::type_decl_vector(Token t) { next(); // Consume the peek - size_t count = 2; + uint32_t count = 2; if (t.IsVec3()) count = 3; else if (t.IsVec4()) @@ -856,7 +856,7 @@ ast::type::Type* ParserImpl::type_decl_array(Token t) { } t = next(); - size_t size = 0; + uint32_t size = 0; if (t.IsComma()) { t = next(); if (!t.IsIntLiteral()) { @@ -867,7 +867,7 @@ ast::type::Type* ParserImpl::type_decl_array(Token t) { set_error(t, "invalid size for array declaration"); return nullptr; } - size = static_cast(t.to_i32()); + size = static_cast(t.to_i32()); t = next(); } if (!t.IsGreaterThan()) { @@ -882,8 +882,8 @@ ast::type::Type* ParserImpl::type_decl_array(Token t) { ast::type::Type* ParserImpl::type_decl_matrix(Token t) { next(); // Consume the peek - size_t rows = 2; - size_t columns = 2; + uint32_t rows = 2; + uint32_t columns = 2; if (t.IsMat3x2() || t.IsMat3x3() || t.IsMat3x4()) { rows = 3; } else if (t.IsMat4x2() || t.IsMat4x3() || t.IsMat4x4()) { @@ -1181,8 +1181,7 @@ ParserImpl::struct_member_decoration() { return nullptr; } - return std::make_unique( - static_cast(val)); + return std::make_unique(val); } // function_decl diff --git a/src/scope_stack_test.cc b/src/scope_stack_test.cc index 303f7a3c68..2f3129262b 100644 --- a/src/scope_stack_test.cc +++ b/src/scope_stack_test.cc @@ -37,7 +37,7 @@ TEST_F(ScopeStackTest, Global_SetWithPointer) { ScopeStack s; s.set_global("var", &v); - ast::Variable* v2; + ast::Variable* v2 = nullptr; EXPECT_TRUE(s.get("var", &v2)); EXPECT_EQ(v2->name(), "my_var"); }