From 7a3f53ba446ae2600763ee37b7f8dcc91de3ec5f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 2 Aug 2015 21:51:41 -0500 Subject: Mark command-local functions static. --- toys/other/acpi.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'toys/other/acpi.c') diff --git a/toys/other/acpi.c b/toys/other/acpi.c index 44fd03b1..363cfb99 100644 --- a/toys/other/acpi.c +++ b/toys/other/acpi.c @@ -25,10 +25,7 @@ config ACPI #include "toys.h" GLOBALS( - int ac; - int bat; - int therm; - int cool; + int ac, bat, therm, cool; char *cpath; ) @@ -44,7 +41,7 @@ int read_int_at(int dirfd, char *name) return ret; } -int acpi_callback(struct dirtree *tree) +static int acpi_callback(struct dirtree *tree) { int dfd, fd, len, on; @@ -85,11 +82,11 @@ done: return 0; } -int temp_callback(struct dirtree *tree) +static int temp_callback(struct dirtree *tree) { int dfd, temp; - if (tree->name[0]=='.') return 0; + if (*tree->name=='.') return 0; if (!tree->parent || !tree->parent->parent) return DIRTREE_RECURSE|DIRTREE_SYMFOLLOW; errno = 0; @@ -98,17 +95,17 @@ int temp_callback(struct dirtree *tree) if ((0 < (temp = read_int_at(dfd, "temp"))) || !errno) { //some tempertures are in milli-C, some in deci-C //reputedly some are in deci-K, but I have not seen them - if (((temp >= 1000) || (temp <= -1000)) && (temp%100 == 0)) - temp /= 100; + if (((temp >= 1000) || (temp <= -1000)) && (temp%100 == 0)) temp /= 100; printf("Thermal %d: %d.%d degrees C\n", TT.therm++, temp/10, temp%10); } close(dfd); } free(TT.cpath); + return 0; } -int cool_callback(struct dirtree *tree) +static int cool_callback(struct dirtree *tree) { int dfd=5, cur, max; -- cgit v1.2.3