Make some global variables static 28/225928/2
authorMichal Bloch <m.bloch@samsung.com>
Tue, 25 Feb 2020 10:01:10 +0000 (11:01 +0100)
committerMichal Bloch <m.bloch@partner.samsung.com>
Tue, 25 Feb 2020 10:12:53 +0000 (10:12 +0000)
Change-Id: I0bbe2c4fbfa052abc85eff3f5f97498bbcefdc31
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/libdlog/log.c
src/libdlog/loglimiter.c
src/logger/logger.c

index 815afe6..08d1e6a 100644 (file)
@@ -60,9 +60,9 @@ extern void __dlog_init_pipe(const struct log_config *conf);
 extern void __dlog_init_android(const struct log_config *conf);
 
 bool limiter;
-bool dynamic_config;
-bool plog[LOG_ID_MAX];
-bool plog_default_values[LOG_ID_MAX];
+static bool dynamic_config;
+static bool plog[LOG_ID_MAX];
+static bool plog_default_values[LOG_ID_MAX];
 
 static int debugmode;
 static int fatal_assert;
index ad765e6..5ca035c 100644 (file)
@@ -49,11 +49,11 @@ struct hashmap {
        void* bucket[];
 };
 
-struct hashmap* rules_hashmap = NULL;
+static struct hashmap* rules_hashmap = NULL;
 
 /* Keep rules table as single-linked list */
-struct rule* current_rules_table = NULL;
-struct rule* original_rules_table = NULL;
+static struct rule* current_rules_table = NULL;
+static struct rule* original_rules_table = NULL;
 
 #define HASHMAP_MASK(hm)          ((int)(hm->size - 1))
 #define HASHMAP_LINEAR_PROBE_LEAP 1
index 2b4c5cf..4cbfa9a 100644 (file)
@@ -48,7 +48,7 @@ int socket_initialize(struct sock_data *sock, struct log_buffer *buffer, service
 /** global state when logger is not interrupted by any handled signals */
 static volatile sig_atomic_t g_logger_run = 1;
 
-struct {
+static struct {
        int (*reader_init)(struct reader *reader, const char *buf_name, struct logger *server);
        char logger_devices[LOG_ID_MAX][MAX_CONF_VAL_LEN];
        int logger_device_throttling[LOG_ID_MAX];