projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clang-format a few files to make CI happy
[collectd.git]
/
src
/
daemon
/
plugin.c
diff --git
a/src/daemon/plugin.c
b/src/daemon/plugin.c
index
c2017ac
..
c18b2c4
100644
(file)
--- a/
src/daemon/plugin.c
+++ b/
src/daemon/plugin.c
@@
-30,14
+30,14
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "configfile.h"
#include "filter_chain.h"
#include "plugin.h"
#include "configfile.h"
#include "filter_chain.h"
#include "plugin.h"
-#include "utils_avltree.h"
+#include "utils/avltree/avltree.h"
+#include "utils/common/common.h"
+#include "utils/heap/heap.h"
#include "utils_cache.h"
#include "utils_complain.h"
#include "utils_cache.h"
#include "utils_complain.h"
-#include "utils_heap.h"
#include "utils_llist.h"
#include "utils_random.h"
#include "utils_time.h"
#include "utils_llist.h"
#include "utils_random.h"
#include "utils_time.h"
@@
-320,7
+320,6
@@
static void log_list_callbacks(llist_t **list, /* {{{ */
int i;
llentry_t *le;
int n;
int i;
llentry_t *le;
int n;
- char **keys;
n = llist_size(*list);
if (n == 0) {
n = llist_size(*list);
if (n == 0) {
@@
-328,11
+327,9
@@
static void log_list_callbacks(llist_t **list, /* {{{ */
return;
}
return;
}
- keys = calloc(n, sizeof(char *));
-
+ char **keys = calloc(n, sizeof(*keys));
if (keys == NULL) {
ERROR("%s: failed to allocate memory for list of callbacks", comment);
if (keys == NULL) {
ERROR("%s: failed to allocate memory for list of callbacks", comment);
-
return;
}
return;
}
@@
-369,7
+366,8
@@
static int create_register_callback(llist_t **list, /* {{{ */
cf->cf_callback = callback;
if (ud == NULL) {
cf->cf_udata = (user_data_t){
cf->cf_callback = callback;
if (ud == NULL) {
cf->cf_udata = (user_data_t){
- .data = NULL, .free_func = NULL,
+ .data = NULL,
+ .free_func = NULL,
};
} else {
cf->cf_udata = *ud;
};
} else {
cf->cf_udata = *ud;
@@
-630,7
+628,7
@@
static void start_read_threads(size_t num) /* {{{ */
if (read_threads != NULL)
return;
if (read_threads != NULL)
return;
- read_threads =
(pthread_t *)calloc(num, sizeof(pthread_t
));
+ read_threads =
calloc(num, sizeof(*read_threads
));
if (read_threads == NULL) {
ERROR("plugin: start_read_threads: calloc failed.");
return;
if (read_threads == NULL) {
ERROR("plugin: start_read_threads: calloc failed.");
return;
@@
-819,7
+817,7
@@
static void start_write_threads(size_t num) /* {{{ */
if (write_threads != NULL)
return;
if (write_threads != NULL)
return;
- write_threads =
(pthread_t *)calloc(num, sizeof(pthread_t
));
+ write_threads =
calloc(num, sizeof(*write_threads
));
if (write_threads == NULL) {
ERROR("plugin: start_write_threads: calloc failed.");
return;
if (write_threads == NULL) {
ERROR("plugin: start_write_threads: calloc failed.");
return;
@@
-1297,8
+1295,10
@@
EXPORT int plugin_register_flush(const char *name, plugin_flush_cb callback,
/* name = */ flush_name,
/* callback = */ plugin_flush_timeout_callback,
/* interval = */ ctx.flush_interval,
/* name = */ flush_name,
/* callback = */ plugin_flush_timeout_callback,
/* interval = */ ctx.flush_interval,
- /* user data = */ &(user_data_t){
- .data = cb, .free_func = plugin_flush_timeout_callback_free,
+ /* user data = */
+ &(user_data_t){
+ .data = cb,
+ .free_func = plugin_flush_timeout_callback_free,
});
sfree(flush_name);
});
sfree(flush_name);