From 9d58219557a95f0f231ca36350c4bade8ed70739 Mon Sep 17 00:00:00 2001 From: FredrikFornstad Date: Wed, 20 May 2020 19:32:18 +0200 Subject: [PATCH] Bugfix: Casting int to size_t --- components/soc/src/esp32/include/hal/cpu_ll.h | 2 +- components/soc/src/esp32s2/include/hal/cpu_ll.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/soc/src/esp32/include/hal/cpu_ll.h b/components/soc/src/esp32/include/hal/cpu_ll.h index f063576fb..d8b3d6a4d 100644 --- a/components/soc/src/esp32/include/hal/cpu_ll.h +++ b/components/soc/src/esp32/include/hal/cpu_ll.h @@ -116,7 +116,7 @@ static inline void cpu_ll_set_watchpoint(int id, //We support watching 2^n byte values, from 1 to 64. Calculate the mask for that. for (int x = 0; x < 7; x++) { - if (size == (1 << x)) { + if (size == (size_t)(1 << x)) { break; } dbreakc <<= 1; diff --git a/components/soc/src/esp32s2/include/hal/cpu_ll.h b/components/soc/src/esp32s2/include/hal/cpu_ll.h index cfcefc3de..c0a96ca6c 100644 --- a/components/soc/src/esp32s2/include/hal/cpu_ll.h +++ b/components/soc/src/esp32s2/include/hal/cpu_ll.h @@ -110,7 +110,7 @@ static inline void cpu_ll_set_watchpoint(int id, //We support watching 2^n byte values, from 1 to 64. Calculate the mask for that. for (int x = 0; x < 7; x++) { - if (size == (1 << x)) { + if (size == (size_t)(1 << x)) { break; } dbreakc <<= 1;