2 An optimization used an incorrect cast to bool.
7 #pragma disable_warning 283
13 #define UINT16 uint16_t
15 #define U_LESS_THAN(A, B) ((A) - (B) & 0x8000u)
16 #define DISTANCE(A, B) (U_LESS_THAN(A, B) ? (B - A) : (A - B))
19 UINT8 anim_accum_ticks
;
28 struct Sprite spr
, tgt
;
30 struct Sprite
*THIS
, *scroll_target
;
32 #define DIST_ACTION 10
34 int mputs(const char *s
)
36 ASSERT (!strcmp (s
, "no action"));
40 if(U_LESS_THAN(DISTANCE(THIS
->x
+ 8, scroll_target
->x
+ 8), DIST_ACTION
)) mputs("action"); else mputs("no action");
45 spr
.x
= 10, THIS
= &spr
;
46 tgt
.x
= 30, scroll_target
= &tgt
;