From 9c3ae23a15ad2f8947b807d55d2b1d4c8e1b57bf Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Wed, 20 Feb 2008 10:01:23 +0000 Subject: [PATCH] Fixed a few minor type issues git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1005 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 13 ++++--------- src/freebsd.c | 8 ++++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/conky.c b/src/conky.c index 827958f..ac7bb4e 100644 --- a/src/conky.c +++ b/src/conky.c @@ -476,7 +476,7 @@ static char text_buffer[TEXT_BUFFER_SIZE * 4]; #define SPECIAL_CHAR '\x01' -enum { +enum special_types { HORIZONTAL_LINE, STIPPLED_HR, BAR, @@ -517,7 +517,7 @@ static unsigned int special_index; /* used when drawing */ #define MAX_GRAPH_DEPTH 256 /* why 256? cause an array of more then 256 doubles seems excessive, and who needs that kind of precision anyway? */ -static struct special_t *new_special(char *buf, int t) +static struct special_t *new_special(char *buf, enum special_types t) { if (special_count >= max_specials) CRIT_ERR("too many special things in text"); @@ -560,8 +560,7 @@ long fwd_fcharfind(FILE* fp, char val, unsigned int step) { } #ifndef HAVE_MEMRCHR -void * -memrchr (const void *buffer, int c, size_t n) +void *memrchr(const void *buffer, char c, size_t n) { const unsigned char *p = buffer; @@ -593,11 +592,7 @@ long rev_fcharfind(FILE* fp, char val, unsigned int step) { file_pos = ftell(fp); buf_pos = fread(buf, 1, buf_size, fp); } - cur_found = - memrchr( - buf, - (int)val, - (size_t)buf_pos); + cur_found = memrchr(buf, val, (size_t) buf_pos); if(cur_found != NULL) { buf_pos = cur_found-buf; count++; diff --git a/src/freebsd.c b/src/freebsd.c index 6386dfd..8b754a6 100644 --- a/src/freebsd.c +++ b/src/freebsd.c @@ -354,7 +354,7 @@ update_cpu_usage() double get_sysfs_info(int *fd, int arg, char *devtype, char *type) { - return (0); + return 0.0; } void @@ -363,9 +363,9 @@ update_load_average() double v[3]; getloadavg(v, 3); - info.loadavg[0] = (float) v[0]; - info.loadavg[1] = (float) v[1]; - info.loadavg[2] = (float) v[2]; + info.loadavg[0] = (double) v[0]; + info.loadavg[1] = (double) v[1]; + info.loadavg[2] = (double) v[2]; } double -- 1.7.9.5