This commit is contained in:
twinaphex 2015-09-02 12:54:31 +02:00
parent a28dd3944c
commit 97dae69f28

View File

@ -158,7 +158,7 @@ check_proc_acpi_battery(const char * node, bool * have_battery,
case ACPI_KEY_REMAINING_CAPACITY: case ACPI_KEY_REMAINING_CAPACITY:
{ {
char *endptr = NULL; char *endptr = NULL;
const int cvt = (int) strtol(val, &endptr, 10); const int cvt = (int)strtol(val, &endptr, 10);
if (*endptr == ' ') if (*endptr == ' ')
remaining = cvt; remaining = cvt;
@ -178,7 +178,7 @@ check_proc_acpi_battery(const char * node, bool * have_battery,
case ACPI_KEY_DESIGN_CAPACITY: case ACPI_KEY_DESIGN_CAPACITY:
{ {
char *endptr = NULL; char *endptr = NULL;
const int cvt = (int) strtol(val, &endptr, 10); const int cvt = (int)strtol(val, &endptr, 10);
if (*endptr == ' ') if (*endptr == ' ')
maximum = cvt; maximum = cvt;
@ -192,7 +192,7 @@ check_proc_acpi_battery(const char * node, bool * have_battery,
pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f); pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f);
if (pct < 0) if (pct < 0)
pct = 0; pct = 0;
else if (pct > 100) if (pct > 100)
pct = 100; pct = 100;
} }