From f939015b978b689fb86dde69fcfeea6b864eed3e Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Mon, 6 Feb 2012 12:43:03 -0800 Subject: [PATCH] Default to int32 for declarations without specified types. (e.g. "uniform foo" == "uniform int32 foo") --- decl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/decl.cpp b/decl.cpp index fd96d3c0..ec8022b7 100644 --- a/decl.cpp +++ b/decl.cpp @@ -113,6 +113,12 @@ DeclSpecs::DeclSpecs(const Type *t, StorageClass sc, int tq) { const Type * DeclSpecs::GetBaseType(SourcePos pos) const { const Type *bt = baseType; + + if (bt == NULL) { + Warning(pos, "No type specified in declaration. Assuming int32."); + bt = AtomicType::UnboundInt32; + } + if (vectorSize > 0) { const AtomicType *atomicType = dynamic_cast(bt); if (atomicType == NULL) {