Default to int32 for declarations without specified types.
(e.g. "uniform foo" == "uniform int32 foo")
This commit is contained in:
6
decl.cpp
6
decl.cpp
@@ -113,6 +113,12 @@ DeclSpecs::DeclSpecs(const Type *t, StorageClass sc, int tq) {
|
|||||||
const Type *
|
const Type *
|
||||||
DeclSpecs::GetBaseType(SourcePos pos) const {
|
DeclSpecs::GetBaseType(SourcePos pos) const {
|
||||||
const Type *bt = baseType;
|
const Type *bt = baseType;
|
||||||
|
|
||||||
|
if (bt == NULL) {
|
||||||
|
Warning(pos, "No type specified in declaration. Assuming int32.");
|
||||||
|
bt = AtomicType::UnboundInt32;
|
||||||
|
}
|
||||||
|
|
||||||
if (vectorSize > 0) {
|
if (vectorSize > 0) {
|
||||||
const AtomicType *atomicType = dynamic_cast<const AtomicType *>(bt);
|
const AtomicType *atomicType = dynamic_cast<const AtomicType *>(bt);
|
||||||
if (atomicType == NULL) {
|
if (atomicType == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user