mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Fix compilation.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1008 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
3d26a4880e
commit
ae8c4198b8
14
src/conky.c
14
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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user