From: Brenden Matthews Date: Wed, 24 Aug 2005 20:35:25 +0000 (+0000) Subject: doc makefile X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=c85fa7a0895691708d17025f117a6a83aa43dc47;p=monky doc makefile git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@163 7f574dfc-610e-0410-a909-a81674777703 --- diff --git a/doc/Makefile.am b/doc/Makefile.am index fae8388..0f98d79 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,21 +1,25 @@ -man_MANS = conky.1.gz ../README docs.html - clean-am: clean-generic mostlyclean-am rm -f docs.mxml - rm -f conky.1.gz + rm -f conky.1 if HAVE_DOCSTUFF + +man_MANS = conky.1 ../README docs.html + conky.1.gz: command_options.xml config_settings.xml docs.xml variables.xml ${DB2X_XSLPROC} -s man ${srcdir}/docs.xml -o docs.mxml ${DB2X_MANXML} docs.mxml - gzip -f conky.1 docs.html: command_options.xml config_settings.xml docs.xml variables.xml ${XSLPROC} http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl ${srcdir}/docs.xml > docs.html ../README: conky.1.gz - man ./conky.1.gz | col -b > README + man ./conky.1 | col -b > README mv README ${top_srcdir} +else + +man_MANS = ../README + endif EXTRA_DIST = conkyrc.sample conky.1.gz docs.html command_options.xml config_settings.xml docgen.sh docs.xml variables.xml diff --git a/src/conky.c b/src/conky.c index dc0bc16..31b457a 100644 --- a/src/conky.c +++ b/src/conky.c @@ -1615,10 +1615,10 @@ static void generate_text() i)+ 40) * 9.0 / 5 - 40)); } OBJ(freq) { - snprintf(p, n, "%sMhz", get_freq()); + snprintf(p, n, "%.0fMhz", get_freq()); } OBJ(freq_g) { - float ghz = (float)(atof(get_freq())/1000); + float ghz = (float)(get_freq()/1000); //printf("%f\n", ghz); snprintf(p, n, "%'.2fGhz", ghz); } diff --git a/src/conky.h b/src/conky.h index 87ac921..264f3e9 100644 --- a/src/conky.h +++ b/src/conky.h @@ -266,7 +266,7 @@ void update_wifi_stats(void); void update_cpu_usage(void); void update_total_processes(void); void update_running_processes(void); -char *get_freq(); +float get_freq(); void update_load_average(); int open_i2c_sensor(const char *dev, const char *type, int n, int *div, char *devtype); diff --git a/src/linux.c b/src/linux.c index 561ca01..f25e8e9 100644 --- a/src/linux.c +++ b/src/linux.c @@ -663,7 +663,7 @@ static char *buffer = NULL; static char *frequency; #endif -char *get_freq() +float get_freq() { #if defined(__i386) || defined(__x86_64) if (buffer == NULL) @@ -689,7 +689,7 @@ char *get_freq() sprintf(buffer, "%lld", (cycles[1] - cycles[0]) / microseconds); - return buffer; + return strtod(buffer, (char **)NULL); #else FILE *f; char s[1000]; @@ -711,7 +711,7 @@ char *get_freq() } fclose(f); //printf("%s\n", frequency); - return frequency; + return strtod(frequency, (char **)NULL); #endif }