Fix the SCANBIT macro by forcing it to use 32 bits

Naively using the "1 << n" shifting will default to 8 bits, because 1
fits in there. To make it 32-bit aware, not just by context (at which
point the damage may have already be done), force the "1" into a
uint32_t.

This silences the warnings, and also corrects the defines.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/34/head
Gergely Nagy 8 years ago
parent f665f9acaf
commit 35538ec6f0

@ -48,7 +48,7 @@ class Model01 {
};
#define SCANBIT(row,col) (1 << (row * 8 + (7 - col)))
#define SCANBIT(row,col) ((uint32_t)1 << (row * 8 + (7 - col)))
#define R0C0 SCANBIT(0, 0)
#define R0C1 SCANBIT(0, 1)

Loading…
Cancel
Save