X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmemory.c;h=4a3a7723b5a2442ae299c228b2152f373256b7a7;hb=25824c65721f0f21cadf1607fad367c7e7831816;hp=80b110493399d1b738bc192ee5e373fde32a1365;hpb=a9e50e9e30ecde17e167e271060c8183bfcbf407;p=collectd.git diff --git a/src/memory.c b/src/memory.c index 80b11049..4a3a7723 100644 --- a/src/memory.c +++ b/src/memory.c @@ -25,8 +25,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #ifdef HAVE_SYS_SYSCTL_H #include @@ -94,8 +94,8 @@ static int pagesize; #error "No applicable input method." #endif -static _Bool values_absolute = 1; -static _Bool values_percentage = 0; +static bool values_absolute = true; +static bool values_percentage; static int memory_config(oconfig_item_t *ci) /* {{{ */ { @@ -163,9 +163,9 @@ static int memory_init(void) { #define MEMORY_SUBMIT(...) \ do { \ if (values_absolute) \ - plugin_dispatch_multivalue(vl, 0, DS_TYPE_GAUGE, __VA_ARGS__, NULL); \ + plugin_dispatch_multivalue(vl, false, DS_TYPE_GAUGE, __VA_ARGS__, NULL); \ if (values_percentage) \ - plugin_dispatch_multivalue(vl, 1, DS_TYPE_GAUGE, __VA_ARGS__, NULL); \ + plugin_dispatch_multivalue(vl, true, DS_TYPE_GAUGE, __VA_ARGS__, NULL); \ } while (0) static int memory_read_internal(value_list_t *vl) { @@ -268,7 +268,7 @@ static int memory_read_internal(value_list_t *vl) { char *fields[8]; int numfields; - _Bool detailed_slab_info = 0; + bool detailed_slab_info = false; gauge_t mem_total = 0; gauge_t mem_used = 0; @@ -299,10 +299,10 @@ static int memory_read_internal(value_list_t *vl) { val = &mem_slab_total; else if (strncasecmp(buffer, "SReclaimable:", 13) == 0) { val = &mem_slab_reclaimable; - detailed_slab_info = 1; + detailed_slab_info = true; } else if (strncasecmp(buffer, "SUnreclaim:", 11) == 0) { val = &mem_slab_unreclaimable; - detailed_slab_info = 1; + detailed_slab_info = true; } else continue;