X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbattery.c;h=8a96e8990f672e6ba98fed8d7d067dc905254f59;hb=edd9af8a874ebc9f2a7f02846807229a648917db;hp=c4c050d7ff1cd11cc70cd2d17323f90da747e542;hpb=2bda2a5648c87a2c5b8304238cd80ff17984c5cd;p=collectd.git diff --git a/src/battery.c b/src/battery.c index c4c050d7..8a96e899 100644 --- a/src/battery.c +++ b/src/battery.c @@ -143,7 +143,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 +341,7 @@ static void get_via_generic_iokit (double *ret_capacity_full, /* {{{ */ *ret_voltage = temp_double / 1000.0; } } - + CFRelease (bat_root_dict); } @@ -358,7 +358,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 */