@cryptotaxi247 / netdata-1 / commits / 28b7926cb

fix compiler warnings (#16763)

Costa Tsaousis committed Jan 11, 2024 at 21:40 UTC 28b7926cb56bdd27df6f06b094a4ef814a416a33
9 files changed +11 -11
daemon/config/dyncfg-echo.c
+1 -1
@@ -16,7 +16,7 @@ struct dyncfg_echo {
16 BUFFER *wb;
17 };
18
19 -void dyncfg_echo_cb(BUFFER *wb __maybe_unused, int code, void *result_cb_data) {
19 +void dyncfg_echo_cb(BUFFER *wb __maybe_unused, int code __maybe_unused, void *result_cb_data) {
20 struct dyncfg_echo *e = result_cb_data;
21
22 buffer_free(e->wb);
daemon/config/dyncfg-inline.c
+1 -1
@@ -4,7 +4,7 @@
4
5 static DICTIONARY *dyncfg_nodes = NULL;
6
7 -static int dyncfg_inline_callback(struct rrd_function_execute *rfe, void *data) {
7 +static int dyncfg_inline_callback(struct rrd_function_execute *rfe, void *data __maybe_unused) {
8 char tr[UUID_COMPACT_STR_LEN];
9 uuid_unparse_lower_compact(*rfe->transaction, tr);
10
daemon/config/dyncfg-intercept.c
+1 -1
@@ -157,7 +157,7 @@ static void dyncfg_apply_action_on_all_template_jobs(const char *template_id, DY
157 DYNCFG *df;
158 dfe_start_reentrant(dyncfg_globals.nodes, df) {
159 if(df->template == template && df->type == DYNCFG_TYPE_JOB) {
160 - DYNCFG_STATUS cmd_to_send_to_plugin = c;
160 + DYNCFG_CMDS cmd_to_send_to_plugin = c;
161
162 if(c == DYNCFG_CMD_ENABLE)
163 cmd_to_send_to_plugin = df->user_disabled ? DYNCFG_CMD_DISABLE : DYNCFG_CMD_ENABLE;
daemon/config/dyncfg-tree.c
+1 -1
@@ -46,7 +46,7 @@ static void dyncfg_to_json(DYNCFG *df, const char *id, BUFFER *wb) {
46 buffer_json_object_close(wb);
47 }
48
49 -static void dyncfg_tree_for_host(RRDHOST *host, BUFFER *wb, const char *parent, const char *id) {
49 +static void dyncfg_tree_for_host(RRDHOST *host, BUFFER *wb, const char *parent, const char *id __maybe_unused) {
50 size_t entries = dictionary_entries(dyncfg_globals.nodes);
51 size_t used = 0;
52 const DICTIONARY_ITEM *items[entries];
daemon/config/dyncfg-unittest.c
+2 -2
@@ -164,7 +164,7 @@ static int dyncfg_unittest_action(struct dyncfg_unittest_action *a) {
164 return rc;
165 }
166
167 -static void *dyncfg_unittest_thread_action(void *ptr) {
167 +static void *dyncfg_unittest_thread_action(void *ptr __maybe_unused) {
168 while(1) {
169 struct dyncfg_unittest_action *a = NULL;
170 spinlock_lock(&dyncfg_unittest_data.spinlock);
@@ -526,7 +526,7 @@ static void dyncfg_unittest_cleanup_files(void) {
526 }
527
528 struct dirent *entry;
529 - char filename[PATH_MAX];
529 + char filename[FILENAME_MAX];
530 while ((entry = readdir(dir)) != NULL) {
531 if ((entry->d_type == DT_REG || entry->d_type == DT_LNK) && strstartswith(entry->d_name, "unittest:") && strendswith(entry->d_name, ".dyncfg")) {
532 snprintf(filename, sizeof(filename), "%s/%s", path, entry->d_name);
daemon/config/dyncfg.c
+1 -1
@@ -323,7 +323,7 @@ bool dyncfg_add_low_level(RRDHOST *host, const char *id, const char *path, DYNCF
323 dyncfg_function_intercept_cb,
324 NULL);
325
326 - DYNCFG_STATUS status_to_send_to_plugin = df->user_disabled ? DYNCFG_CMD_DISABLE : DYNCFG_CMD_ENABLE;
326 + DYNCFG_CMDS status_to_send_to_plugin = df->user_disabled ? DYNCFG_CMD_DISABLE : DYNCFG_CMD_ENABLE;
327 if(status_to_send_to_plugin == DYNCFG_CMD_ENABLE && dyncfg_is_user_disabled(string2str(df->template)))
328 status_to_send_to_plugin = DYNCFG_CMD_DISABLE;
329
libnetdata/simple_hashtable.h
+1 -1
@@ -245,7 +245,7 @@ static inline void simple_hashtable_del_value_sorted_named(SIMPLE_HASHTABLE_NAME
245 static inline void simple_hashtable_replace_value_sorted_named(SIMPLE_HASHTABLE_NAMED *ht __maybe_unused, SIMPLE_HASHTABLE_VALUE_TYPE *old_value __maybe_unused, SIMPLE_HASHTABLE_VALUE_TYPE *new_value __maybe_unused) { ; }
246 #endif
247
248 -static void simple_hashtable_init_named(SIMPLE_HASHTABLE_NAMED *ht, size_t size) {
248 +static inline void simple_hashtable_init_named(SIMPLE_HASHTABLE_NAMED *ht, size_t size) {
249 memset(ht, 0, sizeof(*ht));
250 ht->size = size;
251 ht->hashtable = callocz(ht->size, sizeof(*ht->hashtable));
web/server/web_client.c
+1 -1
@@ -183,7 +183,7 @@ static void web_client_reset_allocations(struct web_client *w, bool free_all) {
183 web_client_flag_clear(w, WEB_CLIENT_CHUNKED_TRANSFER);
184 }
185
186 - web_client_flags_check_auth(w);
186 + web_client_flags_clear_auth(w);
187 web_client_flag_clear(w, WEB_CLIENT_ENCODING_GZIP|WEB_CLIENT_ENCODING_DEFLATE);
188 web_client_reset_path_flags(w);
189 }
web/server/web_client.h
+2 -2
@@ -74,8 +74,8 @@ typedef enum __attribute__((packed)) {
74 #define web_client_reset_path_flags(w) (w)->flags &= ~(WEB_CLIENT_FLAG_PATH_WITH_VERSION|WEB_CLIENT_FLAG_PATH_HAS_TRAILING_SLASH|WEB_CLIENT_FLAG_PATH_HAS_FILE_EXTENSION)
75
76 #define web_client_flag_check(w, flag) ((w)->flags & (flag))
77 -#define web_client_flag_set(w, flag) (w)->flags |= flag
78 -#define web_client_flag_clear(w, flag) (w)->flags &= ~flag
77 +#define web_client_flag_set(w, flag) (w)->flags |= (flag)
78 +#define web_client_flag_clear(w, flag) (w)->flags &= ~(flag)
79
80 #define WEB_CLIENT_IS_DEAD(w) web_client_flag_set(w, WEB_CLIENT_FLAG_DEAD)
81 #define web_client_check_dead(w) web_client_flag_check(w, WEB_CLIENT_FLAG_DEAD)