Fixes overflows on CPUs with 16-bit ints

As reported by Giovanni Rovatti, this should fix some TI C55 issues.
3 files changed