Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame^] | 1 | From 874da836bc857e5942675c59e19f4fd8ad09b13e Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 29 Aug 2019 14:08:19 -0700 |
| 4 | Subject: [PATCH 1/4] log: Avoid shadowing functions from std lib |
| 5 | |
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 7 | --- |
| 8 | lib/log/log.c | 2 +- |
| 9 | lib/log/log.h | 8 ++++---- |
| 10 | 2 files changed, 5 insertions(+), 5 deletions(-) |
| 11 | |
| 12 | diff --git a/lib/log/log.c b/lib/log/log.c |
| 13 | index 7d8e17c..18b67a5 100644 |
| 14 | --- a/lib/log/log.c |
| 15 | +++ b/lib/log/log.c |
| 16 | @@ -82,7 +82,7 @@ enum log_level log_get_level(void) { |
| 17 | } |
| 18 | |
| 19 | /* */ |
| 20 | -void __log(enum log_level level, const char *message) { |
| 21 | +void _ssiap_log(enum log_level level, const char *message) { |
| 22 | struct tm tm; |
| 23 | struct timeval tv; |
| 24 | |
| 25 | diff --git a/lib/log/log.h b/lib/log/log.h |
| 26 | index d94e482..66a707b 100644 |
| 27 | --- a/lib/log/log.h |
| 28 | +++ b/lib/log/log.h |
| 29 | @@ -53,13 +53,13 @@ enum log_level { |
| 30 | }; |
| 31 | |
| 32 | /* */ |
| 33 | -#define log(__level, __message) \ |
| 34 | +#define ssiap_log(__level, __message) \ |
| 35 | do { if (log_get_level() >= (enum log_level)(__level)) \ |
| 36 | - __log(__level, __message); \ |
| 37 | + _ssiap_log(__level, __message); \ |
| 38 | } while (0) |
| 39 | |
| 40 | #define dlog(__message) \ |
| 41 | - log(LOG_DEBUG, __message); |
| 42 | + ssiap_log(LOG_DEBUG, __message); |
| 43 | |
| 44 | /* */ |
| 45 | void log_init(enum log_level level, const char *path); |
| 46 | @@ -68,7 +68,7 @@ void log_init(enum log_level level, const char *path); |
| 47 | void log_fini(void); |
| 48 | |
| 49 | /* */ |
| 50 | -void __log(enum log_level level, const char *message); |
| 51 | +void _ssiap_log(enum log_level level, const char *message); |
| 52 | |
| 53 | /* */ |
| 54 | enum log_level log_get_level(void); |
| 55 | -- |
| 56 | 2.23.0 |
| 57 | |