From db2ecc9bf2eb8ab494a007fbd0bf4e21b9bfac56 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Wed, 2 Oct 2024 09:37:00 +0200 Subject: [PATCH] bricks/mpconfigport: Fix parentheses around '-' with '&'. In case i is itself an arithmatic operation. --- bricks/_common_stm32/mpconfigport.h | 2 +- bricks/ev3/mpconfigport.h | 2 +- bricks/ev3rt/mpconfigport.h | 2 +- bricks/virtualhub/mpconfigvariant.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bricks/_common_stm32/mpconfigport.h b/bricks/_common_stm32/mpconfigport.h index bd4a3a5e1..8a846fffb 100644 --- a/bricks/_common_stm32/mpconfigport.h +++ b/bricks/_common_stm32/mpconfigport.h @@ -52,7 +52,7 @@ static inline mp_uint_t disable_irq(void) { } while (0); #define MICROPY_GC_HOOK_LOOP(i) do { \ - if ((i & 0xf) == 0) { \ + if (((i) & 0xf) == 0) { \ MICROPY_VM_HOOK_LOOP \ } \ } while (0) diff --git a/bricks/ev3/mpconfigport.h b/bricks/ev3/mpconfigport.h index d30ef8171..8b7d74235 100644 --- a/bricks/ev3/mpconfigport.h +++ b/bricks/ev3/mpconfigport.h @@ -100,7 +100,7 @@ static inline mp_uint_t disable_irq(void) { } while (0); #define MICROPY_GC_HOOK_LOOP(i) do { \ - if ((i & 0xf) == 0) { \ + if (((i) & 0xf) == 0) { \ MICROPY_VM_HOOK_LOOP \ } \ } while (0) diff --git a/bricks/ev3rt/mpconfigport.h b/bricks/ev3rt/mpconfigport.h index 0f5155503..016414fb7 100644 --- a/bricks/ev3rt/mpconfigport.h +++ b/bricks/ev3rt/mpconfigport.h @@ -104,7 +104,7 @@ static inline mp_uint_t disable_irq(void) { } while (0); #define MICROPY_GC_HOOK_LOOP(i) do { \ - if ((i & 0xf) == 0) { \ + if (((i) & 0xf) == 0) { \ MICROPY_VM_HOOK_LOOP \ } \ } while (0) diff --git a/bricks/virtualhub/mpconfigvariant.h b/bricks/virtualhub/mpconfigvariant.h index 305ab256d..e3f116998 100644 --- a/bricks/virtualhub/mpconfigvariant.h +++ b/bricks/virtualhub/mpconfigvariant.h @@ -101,7 +101,7 @@ } while (0); #define MICROPY_GC_HOOK_LOOP(i) do { \ - if ((i & 0xf) == 0) { \ + if (((i) & 0xf) == 0) { \ MICROPY_VM_HOOK_LOOP \ } \ } while (0)