From ae8c4198b8ec7891298cdc6da232304d50888135 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Sun, 24 Feb 2008 16:35:18 +0000 Subject: [PATCH] Fix compilation. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1008 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 14 +++++++------- src/freebsd.c | 13 ++++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/conky.c b/src/conky.c index 5ceac4a7..3fd05c8d 100644 --- a/src/conky.c +++ b/src/conky.c @@ -5553,7 +5553,7 @@ static void generate_text_internal(char *p, int p_max_size, break; case TOP_CPU: snprintf(p, 7, "%6.2f", - cur->memu[obj->data.top.num]->cpu_perc); + cur->memu[obj->data.top.num]->amount); break; case TOP_PID: snprintf(p, 6, "%5i", @@ -7183,15 +7183,15 @@ void clean_up(void) static int string_to_bool(const char *s) { if (!s) { - return TRUE; + return 1; } else if (strcasecmp(s, "yes") == 0) { - return TRUE; + return 1; } else if (strcasecmp(s, "true") == 0) { - return TRUE; + return 1; } else if (strcasecmp(s, "1") == 0) { - return TRUE; + return 1; } - return FALSE; + return 0; } #ifdef X11 @@ -8147,7 +8147,7 @@ int main(int argc, char **argv) /* handle other command line arguments */ -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) \ || defined(__NetBSD__) optind = optreset = 1; #else diff --git a/src/freebsd.c b/src/freebsd.c index 920fb897..dd3758e8 100644 --- a/src/freebsd.c +++ b/src/freebsd.c @@ -666,8 +666,7 @@ void update_diskio() di = dev_select[dn].position; dev = &statinfo_cur.dinfo->devices[di]; - diskio_current += dev->bytes[DEVSTAT_READ] +0 - dev->bytes[DEVSTAT_WRITE]; + diskio_current += dev->bytes[DEVSTAT_READ] + dev->bytes[DEVSTAT_WRITE]; for (i = 0; i < MAX_DISKIO_STATS; i++) { if (diskio_stats[i].dev && strcmp(dev_select[dn].device_name, @@ -691,7 +690,7 @@ void update_diskio() diskio_stats[i].current = diskio_stats[i].current_read; } diskio_stats[i].last = dev->bytes[DEVSTAT_READ] + - de v->bytes[DEVSTAT_WRITE]; + dev->bytes[DEVSTAT_WRITE]; diskio_stats[i].last_read = dev->bytes[DEVSTAT_READ]; diskio_stats[i].last_write = dev->bytes[DEVSTAT_WRITE]; } @@ -720,9 +719,9 @@ void update_diskio() int comparecpu(const void *a, const void *b) { - if (a->amount > b->amount) { + if (((struct process *)a)->amount > ((struct process *)b)->amount) { return -1; - } else if (a->amount < b->amount) { + } else if (((struct process *)a)->amount < ((struct process *)b)->amount) { return 1; } else { return 0; @@ -731,9 +730,9 @@ int comparecpu(const void *a, const void *b) int comparemem(const void *a, const void *b) { - if (a->totalmem > b->totalmem) { + if (((struct process *)a)->totalmem > ((struct process *)b)->totalmem) { return -1; - } else if (a->totalmem < b->totalmem) { + } else if (((struct process *)a)->totalmem < ((struct process *)b)->totalmem) { return 1; } else { return 0;