From e065e827e91adb4bb683520505873b719f1bc198 Mon Sep 17 00:00:00 2001 From: Andre Prendel Date: Mon, 9 Mar 2009 15:32:03 +0000 Subject: [PATCH] Convert coding style in prog/sensord/ from gnu to kernel style. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5678 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/sensord/args.c | 454 +++++++++++++------------- prog/sensord/chips.c | 561 ++++++++++++++++---------------- prog/sensord/lib.c | 117 +++---- prog/sensord/rrd.c | 703 +++++++++++++++++++++-------------------- prog/sensord/sense.c | 337 ++++++++++---------- prog/sensord/sensord.c | 344 ++++++++++---------- prog/sensord/sensord.h | 61 ++-- 7 files changed, 1327 insertions(+), 1250 deletions(-) diff --git a/prog/sensord/args.c b/prog/sensord/args.c index 3d3b1562..b9b7793a 100644 --- a/prog/sensord/args.c +++ b/prog/sensord/args.c @@ -51,257 +51,271 @@ int debug = 0; sensors_chip_name chipNames[MAX_CHIP_NAMES]; int numChipNames = 0; -static int -parseTime -(char *arg) { - char *end; - int value = strtoul (arg, &end, 10); - if ((end > arg) && (*end == 's')) { - ++ end; - } else if ((end > arg) && (*end == 'm')) { - value *= 60; - ++ end; - } else if ((end > arg) && (*end == 'h')) { - value *= 60 * 60; - ++ end; - } - if ((end == arg) || *end) { - fprintf (stderr, "Error parsing time value `%s'.\n", arg); - return -1; - } - return value; +static int parseTime(char *arg) +{ + char *end; + int value = strtoul(arg, &end, 10); + if ((end > arg) && (*end == 's')) { + ++ end; + } else if ((end > arg) && (*end == 'm')) { + value *= 60; + ++ end; + } else if ((end > arg) && (*end == 'h')) { + value *= 60 * 60; + ++ end; + } + if ((end == arg) || *end) { + fprintf(stderr, "Error parsing time value `%s'.\n", arg); + return -1; + } + return value; } static struct { - const char *name; - int id; + const char *name; + int id; } facilities[] = { - { "local0", LOG_LOCAL0 }, { "local1", LOG_LOCAL1 }, - { "local2", LOG_LOCAL2 }, { "local3", LOG_LOCAL3 }, - { "local4", LOG_LOCAL4 }, { "local5", LOG_LOCAL5 }, - { "local6", LOG_LOCAL6 }, { "local7", LOG_LOCAL7 }, - { "daemon", LOG_DAEMON }, { "user", LOG_USER }, - { NULL, 0 } + { "local0", LOG_LOCAL0 }, + { "local1", LOG_LOCAL1 }, + { "local2", LOG_LOCAL2 }, + { "local3", LOG_LOCAL3 }, + { "local4", LOG_LOCAL4 }, + { "local5", LOG_LOCAL5 }, + { "local6", LOG_LOCAL6 }, + { "local7", LOG_LOCAL7 }, + { "daemon", LOG_DAEMON }, + { "user", LOG_USER }, + { NULL, 0 } }; -static int -parseFacility -(char *arg) { - int i = 0; - while (facilities[i].name && strcasecmp (arg, facilities[i].name)) - ++ i; - if (!facilities[i].name) { - fprintf (stderr, "Error parsing facility value `%s'.\n", arg); - return -1; - } - return facilities[i].id; +static int parseFacility(char *arg) +{ + int i = 0; + while (facilities[i].name && strcasecmp(arg, facilities[i].name)) + ++ i; + if (!facilities[i].name) { + fprintf(stderr, "Error parsing facility value `%s'.\n", arg); + return -1; + } + return facilities[i].id; } static const char *daemonSyntax = - " -i, --interval