From: David Given Date: Tue, 21 May 2013 23:16:16 +0000 (+0100) Subject: Fix signedness problem that was showing up on ARM. X-Git-Tag: release-6-0-pre-5~10^2~55 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f904465e9c2dbc1cb5aec0e4c0ad5e375d3043ed;p=ack.git Fix signedness problem that was showing up on ARM. --HG-- branch : dtrg-videocore --- diff --git a/mach/vc4/as/mach5.c b/mach/vc4/as/mach5.c index b1ce314bc..f3671bf64 100644 --- a/mach/vc4/as/mach5.c +++ b/mach/vc4/as/mach5.c @@ -5,6 +5,8 @@ * See the file 'Copying' in the root of the distribution for the full text. */ +#include + #define maskx(v, x) (v & ((1<<(x))-1)) static void toobig(void) @@ -120,7 +122,7 @@ void branch_instr(int bl, int cc, struct expr_t* expr) /* The VC4 branch instructions express distance in 2-byte * words. */ - int d = (expr->val - pc) / 2; + int d = ((int32_t)expr->val - (int32_t)pc) / 2; /* We now know the worst case for the instruction layout. At * this point we can emit the instructions, which may shrink