From 21b4a0a403a01f297bfc446b22f98097eca30b7c Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Tue, 8 Jan 2019 00:16:56 +0100 Subject: [PATCH] These changes are required to make it build on FreeBSD i386 (x86/32) Otherwise I get this error while building: /wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1503:50: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int') END OBJ(apm_adapter, 0) obj->callbacks.print = &print_apm_adapter; ^~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1504:55: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int') END OBJ(apm_battery_life, 0) obj->callbacks.print = &print_apm_battery_life; ^~~~~~~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/sysutils/conky/work/conky-1.11.1/src/core.cc:1505:55: error: assigning to 'void (*)(struct text_object *, char *, unsigned int)' from incompatible type 'void (*)(struct text_object *, char *, int)': type mismatch at 3rd parameter ('unsigned int' vs 'int') END OBJ(apm_battery_time, 0) obj->callbacks.print = &print_apm_battery_time; ^~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. *** [src/CMakeFiles/conky.dir/core.cc.o] Error code 1 --- src/bsdapm.cc | 6 +++--- src/bsdapm.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bsdapm.cc b/src/bsdapm.cc index 98ded12b..194a5925 100644 --- a/src/bsdapm.cc +++ b/src/bsdapm.cc @@ -61,7 +61,7 @@ static int apm_getinfo(int fd, apm_info_t aip) { return 0; } -void print_apm_adapter(struct text_object *obj, char *p, int p_max_size) { +void print_apm_adapter(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; const char *out; #ifdef __OpenBSD__ @@ -109,7 +109,7 @@ void print_apm_adapter(struct text_object *obj, char *p, int p_max_size) { snprintf(p, p_max_size, "%s", out); } -void print_apm_battery_life(struct text_object *obj, char *p, int p_max_size) { +void print_apm_battery_life(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; u_int batt_life; const char *out; @@ -150,7 +150,7 @@ void print_apm_battery_life(struct text_object *obj, char *p, int p_max_size) { snprintf(p, p_max_size, "%s", out); } -void print_apm_battery_time(struct text_object *obj, char *p, int p_max_size) { +void print_apm_battery_time(struct text_object *obj, char *p, unsigned int p_max_size) { int fd; int batt_time; #ifdef __OpenBSD__ diff --git a/src/bsdapm.h b/src/bsdapm.h index d7da690b..7201c54a 100644 --- a/src/bsdapm.h +++ b/src/bsdapm.h @@ -29,8 +29,8 @@ #ifndef _BSDAPM_H #define _BSDAPM_H -void print_apm_adapter(struct text_object *, char *, int); -void print_apm_battery_life(struct text_object *, char *, int); -void print_apm_battery_time(struct text_object *, char *, int); +void print_apm_adapter(struct text_object *, char *, unsigned int); +void print_apm_battery_life(struct text_object *, char *, unsigned int); +void print_apm_battery_time(struct text_object *, char *, unsigned int); #endif /* _BSDAPM_H */