Possible fix for big-endian bug
git-svn-id: http://picoc.googlecode.com/svn/trunk@371 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
274f21fdbc
commit
2e07f89194
12
expression.c
12
expression.c
|
@ -187,11 +187,19 @@ int ExpressionAssignInt(struct ParseState *Parser, struct Value *DestValue, int
|
|||
ProgramFail(Parser, "can't assign to this");
|
||||
|
||||
if (After)
|
||||
Result = DestValue->Val->Integer;
|
||||
Result = ExpressionCoerceInteger(DestValue);
|
||||
else
|
||||
Result = FromInt;
|
||||
|
||||
DestValue->Val->Integer = FromInt;
|
||||
switch (DestValue->Typ->Base)
|
||||
{
|
||||
case TypeInt: DestValue->Val->Integer = FromInt; break;
|
||||
case TypeShort: DestValue->Val->ShortInteger = (short)FromInt; break;
|
||||
case TypeChar: DestValue->Val->Character = (unsigned char)FromInt; break;
|
||||
case TypeUnsignedInt: DestValue->Val->UnsignedInteger = (unsigned int)FromInt; break;
|
||||
case TypeUnsignedShort: DestValue->Val->UnsignedShortInteger = (unsigned short)FromInt; break;
|
||||
default: break;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue