Skip to content

Commit

Permalink
Fix signed/unsigned issue on non-INTC processors
Browse files Browse the repository at this point in the history
Some ugliness in different GCC versions caused the interpolation steps
to be calculated incorrectly.  Explicitly move through variable of the
right type to ensure proper signedness of operations.
  • Loading branch information
earlephilhower committed Oct 6, 2017
1 parent d881b25 commit 7ad45a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,11 @@ do
// ML : Code47503 is division with remainder, and mem50 gets the sign

// calculate change per frame
signed char m53 = (signed char)mem53;
mem50 = mem53 & 128;
mem51 = abs((char)mem53) % mem40;
mem53 = (unsigned char)((char)(mem53) / mem40);
unsigned char m53abs = abs(m53);
mem51 = m53abs % mem40; //abs((char)m53) % mem40;
mem53 = (unsigned char)((signed char)(m53) / mem40);

// interpolation range
X = mem40; // number of frames to interpolate over
Expand Down

0 comments on commit 7ad45a2

Please sign in to comment.