Skip to content

Commit 70fe034

Browse files
MeguminBOTdimensionscape
authored andcommitted
Give a cppia member field declared Bool its boolean storage
A script class laid out its members by expression type alone, so a Bool member got int storage while a Bool static got Bool storage, and reading the member into Dynamic gave an Int. HaxeFoundation/hxcpp#1367 Fixes #21
1 parent f902b9d commit 70fe034

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎src/hx/cppia/CppiaVars.cpp‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,9 @@ void CppiaVar::linkVarTypes(CppiaModule &cppia, int &ioOffset)
180180
AlignOffset(exprType, ioOffset);
181181
offset = ioOffset;
182182

183-
switch(exprType)
184-
{
185-
case etInt: ioOffset += sizeof(int); storeType=fsInt; break;
186-
case etFloat: ioOffset += sizeof(Float);storeType=fsFloat; break;
187-
case etString: ioOffset += sizeof(String);storeType=fsString; break;
188-
case etObject: ioOffset += sizeof(hx::Object *);storeType=fsObject; break;
189-
case etVoid:
190-
case etNull:
191-
break;
192-
}
183+
storeType = typeId==0 ? fsObject : fieldStorageFromType(type);
184+
185+
ioOffset += sTypeSize[exprType];
193186
}
194187
}
195188

0 commit comments

Comments
 (0)