X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbattery.c;h=4e0c06fdb0d4e5ab567cb47ec5deeef78a087d60;hb=005a70ad7863229b8c60e8ca83b67e89dfb05ad0;hp=c4c050d7ff1cd11cc70cd2d17323f90da747e542;hpb=2c7b491427fd84c9e24c9d41686a15ce42219a0b;p=collectd.git diff --git a/src/battery.c b/src/battery.c index c4c050d7..4e0c06fd 100644 --- a/src/battery.c +++ b/src/battery.c @@ -27,8 +27,6 @@ #include "common.h" #include "plugin.h" -#include "utils_complain.h" - #if HAVE_MACH_MACH_TYPES_H # include #endif @@ -143,7 +141,7 @@ static void submit_capacity (char const *plugin_instance, /* {{{ */ } /* }}} void submit_capacity */ #if HAVE_IOKIT_PS_IOPOWERSOURCES_H || HAVE_IOKIT_IOKITLIB_H -static double dict_get_double (CFDictionaryRef dict, char *key_string) /* {{{ */ +static double dict_get_double (CFDictionaryRef dict, const char *key_string) /* {{{ */ { double val_double; long long val_int; @@ -341,7 +339,7 @@ static void get_via_generic_iokit (double *ret_capacity_full, /* {{{ */ *ret_voltage = temp_double / 1000.0; } } - + CFRelease (bat_root_dict); } @@ -358,7 +356,7 @@ static int battery_read (void) /* {{{ */ * IOPowerSources. IOKit, on the other hand, only reports the full * capacity. We use the two to calculate the current charged capacity. */ gauge_t charge_rel = NAN; /* Current charge in percent */ - gauge_t capacity_charged = NAN; /* Charged capacity */ + gauge_t capacity_charged; /* Charged capacity */ gauge_t capacity_full = NAN; /* Total capacity */ gauge_t capacity_design = NAN; /* Full design capacity */