summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-24 09:57:01 +0100
committerLuke from DC <[email protected]>2022-03-23 04:31:52 +0000
commit353848d7c80b943406379f70dc41536ed7c37d3e (patch)
tree2499705092d333630254424b93cffaa0dcf093c8
parent324b0a5ce370d663707d48e86565bd243838f9c1 (diff)
downloadmate-applets-353848d7c80b943406379f70dc41536ed7c37d3e.tar.bz2
mate-applets-353848d7c80b943406379f70dc41536ed7c37d3e.tar.xz
battstat/power-management.c: use gboolean for pm_initialised, using_upower
-rw-r--r--battstat/battstat.h2
-rw-r--r--battstat/power-management.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/battstat/battstat.h b/battstat/battstat.h
index 77ff8f10..cbe07855 100644
--- a/battstat/battstat.h
+++ b/battstat/battstat.h
@@ -151,6 +151,6 @@ const char *power_management_getinfo (BatteryStatus *status);
const char *power_management_initialise (void (*callback) (void));
void power_management_cleanup (void);
-int power_management_using_upower (void);
+gboolean power_management_using_upower (void);
#endif /* _battstat_h_ */
diff --git a/battstat/power-management.c b/battstat/power-management.c
index ebf8ada6..162801f7 100644
--- a/battstat/power-management.c
+++ b/battstat/power-management.c
@@ -62,9 +62,9 @@
"ACPI subsystem is properly loaded.")
static const char *apm_readinfo (BatteryStatus *status);
-static int pm_initialised;
+static gboolean pm_initialised = FALSE;
#ifdef HAVE_UPOWER
-static int using_upower;
+static gboolean using_upower = FALSE;
#endif
/*
@@ -263,7 +263,7 @@ apm_readinfo (BatteryStatus *status)
fd = open(APMDEVICE, O_RDONLY);
if (fd == -1)
{
- pm_initialised = 0;
+ pm_initialised = FALSE;
return ERR_OPEN_APMDEV;
}
if (ioctl (fd, APM_IOC_GETPOWER, &apminfo) == -1)
@@ -442,7 +442,7 @@ power_management_initialise (void (*callback) (void))
if (err == NULL) /* UPOWER is up */
{
- pm_initialised = 1;
+ pm_initialised = TRUE;
using_upower = TRUE;
return NULL;
}
@@ -483,7 +483,7 @@ power_management_initialise (void (*callback) (void))
else
using_acpi = FALSE;
#endif
- pm_initialised = 1;
+ pm_initialised = TRUE;
return NULL;
}
@@ -500,7 +500,7 @@ power_management_cleanup (void)
if (using_upower)
{
battstat_upower_cleanup ();
- pm_initialised = 1;
+ pm_initialised = TRUE;
return;
}
#endif
@@ -519,16 +519,16 @@ power_management_cleanup (void)
}
#endif
- pm_initialised = 0;
+ pm_initialised = FALSE;
}
-int
+gboolean
power_management_using_upower (void)
{
#ifdef HAVE_UPOWER
return using_upower;
#else
- return 0;
+ return FALSE;
#endif
}