From 59d1ecc78b01807a777797569b185d12cf814139 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Thu, 28 Feb 2019 21:58:47 +0800 Subject: [PATCH] esp32: Remove trialing semicolon from function-like macros This commit removes trailing semicolons following a while(0) from function-like macros in IDF. This will force those macros to be called with a semicolon when called. --- components/esp32/include/esp_err.h | 6 +++--- components/esp32/include/rom/ets_sys.h | 2 +- components/esp32/pm_trace.h | 4 ++-- components/heap/heap_trace.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/esp32/include/esp_err.h b/components/esp32/include/esp_err.h index 6672f233a..794f32e1e 100644 --- a/components/esp32/include/esp_err.h +++ b/components/esp32/include/esp_err.h @@ -104,14 +104,14 @@ void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int l #define ESP_ERROR_CHECK(x) do { \ esp_err_t __err_rc = (x); \ (void) sizeof(__err_rc); \ - } while(0); + } while(0) #elif defined(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT) #define ESP_ERROR_CHECK(x) do { \ esp_err_t __err_rc = (x); \ if (__err_rc != ESP_OK) { \ abort(); \ } \ - } while(0); + } while(0) #else #define ESP_ERROR_CHECK(x) do { \ esp_err_t __err_rc = (x); \ @@ -119,7 +119,7 @@ void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int l _esp_error_check_failed(__err_rc, __FILE__, __LINE__, \ __ASSERT_FUNC, #x); \ } \ - } while(0); + } while(0) #endif /** diff --git a/components/esp32/include/rom/ets_sys.h b/components/esp32/include/rom/ets_sys.h index 6e27b38be..3c34bbe77 100644 --- a/components/esp32/include/rom/ets_sys.h +++ b/components/esp32/include/rom/ets_sys.h @@ -268,7 +268,7 @@ void ets_install_uart_printf(void); ets_printf("%s %u \n", __FILE__, __LINE__); \ while (1) {}; \ } \ -} while (0); +} while (0) /** * @} diff --git a/components/esp32/pm_trace.h b/components/esp32/pm_trace.h index 20eebb0d6..d1cf7e336 100644 --- a/components/esp32/pm_trace.h +++ b/components/esp32/pm_trace.h @@ -39,7 +39,7 @@ void esp_pm_trace_exit(esp_pm_trace_event_t event, int core_id); #else // CONFIG_PM_TRACE -#define ESP_PM_TRACE_ENTER(type, core_id) do { (void) core_id; } while(0); -#define ESP_PM_TRACE_EXIT(type, core_id) do { (void) core_id; } while(0); +#define ESP_PM_TRACE_ENTER(type, core_id) do { (void) core_id; } while(0) +#define ESP_PM_TRACE_EXIT(type, core_id) do { (void) core_id; } while(0) #endif // CONFIG_PM_TRACE diff --git a/components/heap/heap_trace.c b/components/heap/heap_trace.c index 198480859..58babbc19 100644 --- a/components/heap/heap_trace.c +++ b/components/heap/heap_trace.c @@ -282,7 +282,7 @@ inline static uint32_t get_ccount(void) if (!esp_ptr_executable(callers[N])) { \ return; \ } \ - } while(0); + } while(0) /* Static function to read the call stack for a traced heap call.