diff options
Diffstat (limited to 'plugin_cpuinfo.c')
-rw-r--r-- | plugin_cpuinfo.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugin_cpuinfo.c b/plugin_cpuinfo.c index f5923cc..1e9bdea 100644 --- a/plugin_cpuinfo.c +++ b/plugin_cpuinfo.c @@ -1,4 +1,4 @@ -/* $Id: plugin_cpuinfo.c,v 1.10 2004/06/17 06:23:43 reinelt Exp $ +/* $Id: plugin_cpuinfo.c,v 1.11 2004/06/26 09:27:21 reinelt Exp $ * * plugin for /proc/cpuinfo parsing * @@ -23,6 +23,12 @@ * * * $Log: plugin_cpuinfo.c,v $ + * Revision 1.11 2004/06/26 09:27:21 reinelt + * + * added '-W' to CFLAGS + * changed all C++ comments to C ones ('//' => '/* */') + * cleaned up a lot of signed/unsigned mistakes + * * Revision 1.10 2004/06/17 06:23:43 reinelt * * hash handling rewritten to solve performance issues @@ -102,7 +108,7 @@ static int parse_cpuinfo (void) { int age; - // reread every second only + /* reread every second only */ age = hash_age(&CPUinfo, NULL); if (age > 0 && age <= 1000) return 0; @@ -119,17 +125,17 @@ static int parse_cpuinfo (void) c = strchr(buffer, ':'); if (c == NULL) continue; key = buffer; val = c+1; - // strip leading blanks from key + /* strip leading blanks from key */ while (isspace(*key)) *key++ = '\0'; - // strip trailing blanks from key + /* strip trailing blanks from key */ do *c = '\0'; while (isspace(*--c)); - // strip leading blanks from value + /* strip leading blanks from value */ while (isspace(*val)) *val++ = '\0'; - // strip trailing blanks from value + /* strip trailing blanks from value */ for (c = val; *c != '\0'; c++); while (isspace(*--c)) *c = '\0'; - // add entry to hash table + /* add entry to hash table */ hash_put (&CPUinfo, key, val); } |