explicit typecast
This commit is contained in:
parent
255b19e51b
commit
b117a0a132
11
expression.c
11
expression.c
|
@ -510,7 +510,7 @@ void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue,
|
||||||
|
|
||||||
switch (DestValue->Typ->Base) {
|
switch (DestValue->Typ->Base) {
|
||||||
case TypeInt:
|
case TypeInt:
|
||||||
DestValue->Val->Integer = ExpressionCoerceInteger(SourceValue);
|
DestValue->Val->Integer = (int)ExpressionCoerceInteger(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypeShort:
|
case TypeShort:
|
||||||
DestValue->Val->ShortInteger = (short)ExpressionCoerceInteger(SourceValue);
|
DestValue->Val->ShortInteger = (short)ExpressionCoerceInteger(SourceValue);
|
||||||
|
@ -519,10 +519,11 @@ void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue,
|
||||||
DestValue->Val->Character = (char)ExpressionCoerceInteger(SourceValue);
|
DestValue->Val->Character = (char)ExpressionCoerceInteger(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypeLong:
|
case TypeLong:
|
||||||
DestValue->Val->LongInteger = ExpressionCoerceInteger(SourceValue);
|
DestValue->Val->LongInteger = (long)ExpressionCoerceInteger(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypeUnsignedInt:
|
case TypeUnsignedInt:
|
||||||
DestValue->Val->UnsignedInteger = ExpressionCoerceUnsignedInteger(SourceValue);
|
DestValue->Val->UnsignedInteger =
|
||||||
|
(unsigned int)ExpressionCoerceUnsignedInteger(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypeUnsignedShort:
|
case TypeUnsignedShort:
|
||||||
DestValue->Val->UnsignedShortInteger =
|
DestValue->Val->UnsignedShortInteger =
|
||||||
|
@ -530,7 +531,7 @@ void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue,
|
||||||
break;
|
break;
|
||||||
case TypeUnsignedLong:
|
case TypeUnsignedLong:
|
||||||
DestValue->Val->UnsignedLongInteger =
|
DestValue->Val->UnsignedLongInteger =
|
||||||
ExpressionCoerceUnsignedInteger(SourceValue);
|
(unsigned long)ExpressionCoerceUnsignedInteger(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypeUnsignedChar:
|
case TypeUnsignedChar:
|
||||||
DestValue->Val->UnsignedCharacter =
|
DestValue->Val->UnsignedCharacter =
|
||||||
|
@ -540,7 +541,7 @@ void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue,
|
||||||
if (!IS_NUMERIC_COERCIBLE_PLUS_POINTERS(SourceValue, AllowPointerCoercion))
|
if (!IS_NUMERIC_COERCIBLE_PLUS_POINTERS(SourceValue, AllowPointerCoercion))
|
||||||
AssignFail(Parser, "%t from %t", DestValue->Typ, SourceValue->Typ,
|
AssignFail(Parser, "%t from %t", DestValue->Typ, SourceValue->Typ,
|
||||||
0, 0, FuncName, ParamNo);
|
0, 0, FuncName, ParamNo);
|
||||||
DestValue->Val->FP = ExpressionCoerceFP(SourceValue);
|
DestValue->Val->FP = (double)ExpressionCoerceFP(SourceValue);
|
||||||
break;
|
break;
|
||||||
case TypePointer:
|
case TypePointer:
|
||||||
ExpressionAssignToPointer(Parser, DestValue, SourceValue, FuncName,
|
ExpressionAssignToPointer(Parser, DestValue, SourceValue, FuncName,
|
||||||
|
|
Loading…
Reference in a new issue