diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index c46fbf6..4ec4351 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -6314,7 +6314,7 @@ fetchtok: case tRATIONAL: if (!allow_nonint) goto invalid_token; - p->value.ucell=(ucell)(negate ? (val|((cell)1 << (PAWN_CELL_SIZE-1))) : val); + p->value.ucell=(negate ? ((ucell)val|((ucell)1 << (PAWN_CELL_SIZE-1))) : (ucell)val); break; case tSYMBOL: sym=findloc(str); diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index b611086..b4c97dd 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1405,7 +1405,7 @@ static int command(void) break; } else if (current_token==tRATIONAL) { /* change the first bit to make float negative value */ - outval(val|((cell)1 << (PAWN_CELL_SIZE-1)),FALSE); + outval(val|(cell)((ucell)1 << (PAWN_CELL_SIZE-1)),FALSE); code_idx+=opargs(1); break; } else {