X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Ftypeconv.c;h=ecde7349fbaac217d810ac5094d9f50f434dbb99;hb=c6ee5a841878ccdbf9ab85d3dafdd088648b93ba;hp=d26ba32b2e27079733bc273451a4be4dbf5840e3;hpb=a89231ece7d28887ad4e7782ea7d5e4b64ce6399;p=cc65 diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index d26ba32b2..ecde7349f 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -128,7 +128,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType) Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits)); /* If the new type is signed, sign extend the value */ - if (!IsSignUnsigned (NewType)) { + if (IsSignSigned (NewType)) { if (Expr->IVal & (0x01UL << (NewBits-1))) { /* Beware: Use the safe shift routine here. */ Expr->IVal |= shl_l (~0UL, NewBits);