mirror of
https://github.com/cc65/cc65.git
synced 2025-02-12 06:30:42 +00:00
Fixed a typo
git-svn-id: svn://svn.cc65.org/cc65/trunk@481 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
33bd9b5b51
commit
0333dbbd85
@ -1443,14 +1443,14 @@ static int typecast (struct expent* lval)
|
|||||||
/* Cut the value to the new size */
|
/* Cut the value to the new size */
|
||||||
lval->e_const &= (0xFFFFFFFFUL >> (32 - NewBits));
|
lval->e_const &= (0xFFFFFFFFUL >> (32 - NewBits));
|
||||||
|
|
||||||
/* If the new value is signed, sign extend the value */
|
/* If the new value is signed, sign extend the value */
|
||||||
if (!IsSignUnsigned (Type)) {
|
if (!IsSignUnsigned (Type)) {
|
||||||
lval->e_const |= ((~0L) << NewBits);
|
lval->e_const |= ((~0L) << NewBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (NewSize > OldSize) {
|
} else if (NewSize > OldSize) {
|
||||||
|
|
||||||
/* Sign extend the value if needed */
|
/* Sign extend the value if needed */
|
||||||
if (!IsSignUnsigned (Type) && !IsSignUnsigned (lval->e_tptr)) {
|
if (!IsSignUnsigned (Type) && !IsSignUnsigned (lval->e_tptr)) {
|
||||||
if (lval->e_const & (0x01UL << (OldBits-1))) {
|
if (lval->e_const & (0x01UL << (OldBits-1))) {
|
||||||
lval->e_const |= ((~0L) << OldBits);
|
lval->e_const |= ((~0L) << OldBits);
|
||||||
@ -1466,18 +1466,18 @@ static int typecast (struct expent* lval)
|
|||||||
|
|
||||||
/* If the size does not change, leave the value alone. Otherwise,
|
/* If the size does not change, leave the value alone. Otherwise,
|
||||||
* we have to load the value into the primary and generate code to
|
* we have to load the value into the primary and generate code to
|
||||||
* cast teh value in the primary register.
|
* cast the value in the primary register.
|
||||||
*/
|
*/
|
||||||
if (SizeOf (Type) != SizeOf (lval->e_tptr)) {
|
if (SizeOf (Type) != SizeOf (lval->e_tptr)) {
|
||||||
|
|
||||||
/* Load the value into the primary */
|
/* Load the value into the primary */
|
||||||
exprhs (CF_NONE, k, lval);
|
exprhs (CF_NONE, k, lval);
|
||||||
|
|
||||||
/* Mark the lhs as const to avoid a manipulation of TOS */
|
/* Mark the lhs as const to avoid a manipulation of TOS */
|
||||||
g_typecast (TypeOf (Type) | CF_CONST, TypeOf (lval->e_tptr));
|
g_typecast (TypeOf (Type) | CF_CONST, TypeOf (lval->e_tptr));
|
||||||
|
|
||||||
/* Value is now in primary */
|
/* Value is now in primary */
|
||||||
lval->e_flags = E_MEXPR;
|
lval->e_flags = E_MEXPR;
|
||||||
k = 0;
|
k = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user