From: Andre Prendel Date: Mon, 09 Mar 2009 08:45:17 +0000 Subject: [lm-sensors] [PATCH 1/7] sensord: Coding style conversion (gnu -> Message-Id: <20090309084517.GB4636@ubuntu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lm-sensors@vger.kernel.org Fix coding style in args.c --- prog/sensord/args.c | 462 ++++++++++++++++++++++++++-------------------------- 1 file changed, 238 insertions(+), 224 deletions(-) --- quilt-sensors.orig/prog/sensord/args.c 2009-03-06 16:24:55.000000000 +0100 +++ quilt-sensors/prog/sensord/args.c 2009-03-07 23:06:38.000000000 +0100 @@ -51,257 +51,271 @@ 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