From 552c9800a9a394e5ad351309d62278aecd44073f Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Wed, 17 Jun 2015 19:04:57 -0700 Subject: [PATCH] px4_log: Fixed compiler warning when using PX4_LOG If __px4_log_level_current is unsigned then the runtime filter comparison warns because an unsigned value can't be less than zero. Changed typed to signed so compiler will not issue a warning. Signed-off-by: Mark Charlebois --- src/platforms/common/px4_log.c | 2 +- src/platforms/px4_log.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/common/px4_log.c b/src/platforms/common/px4_log.c index 0ee4c2a6ad..a2c61ab297 100644 --- a/src/platforms/common/px4_log.c +++ b/src/platforms/common/px4_log.c @@ -1,5 +1,5 @@ #include -__EXPORT unsigned int __px4_log_level_current = PX4_LOG_LEVEL_AT_RUN_TIME; +__EXPORT int __px4_log_level_current = PX4_LOG_LEVEL_AT_RUN_TIME; __EXPORT const char *__px4_log_level_str[_PX4_LOG_LEVEL_DEBUG+1] = { "INFO", "PANIC", "ERROR", "WARN", "DEBUG" }; diff --git a/src/platforms/px4_log.h b/src/platforms/px4_log.h index d52582f15e..05278131c8 100644 --- a/src/platforms/px4_log.h +++ b/src/platforms/px4_log.h @@ -65,7 +65,7 @@ __EXPORT extern uint64_t hrt_absolute_time(void); #define _PX4_LOG_LEVEL_DEBUG 4 __EXPORT extern const char *__px4_log_level_str[5]; -__EXPORT extern unsigned int __px4_log_level_current; +__EXPORT extern int __px4_log_level_current; // __px4_log_level_current will be initialized to PX4_LOG_LEVEL_AT_RUN_TIME #define PX4_LOG_LEVEL_AT_RUN_TIME _PX4_LOG_LEVEL_WARN