Skip to content

Commit

Permalink
small struct conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Feb 4, 2011
1 parent 7b03445 commit 5cd06ca
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/argtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,19 @@ TypeTuple *TypeDelegate::toArgTypes()

TypeTuple *TypeStruct::toArgTypes()
{
return new TypeTuple(); // pass on the stack for efficiency
int sz = size(0);
switch (sz)
{
case 1:
return new TypeTuple(Type::tint8);
case 2:
return new TypeTuple(Type::tint16);
case 4:
return new TypeTuple(Type::tint32);
case 8:
return new TypeTuple(Type::tint64);
}
return new TypeTuple(); // pass on the stack
}

TypeTuple *TypeEnum::toArgTypes()
Expand Down

0 comments on commit 5cd06ca

Please sign in to comment.