diff --git a/panel-plugin/monitor-label.c b/panel-plugin/monitor-label.c index d70d53f..706f06e 100644 --- a/panel-plugin/monitor-label.c +++ b/panel-plugin/monitor-label.c @@ -38,8 +38,6 @@ struct _XnlpMonitorLabel G_DEFINE_TYPE (XnlpMonitorLabel, xnlp_monitor_label, GTK_TYPE_LABEL) -static void xnlp_monitor_label_constructed (GObject *object); - static void cb_label_changed (GObject *object, GParamSpec *pspec, gpointer user_data); @@ -49,7 +47,6 @@ static void cb_label_changed (GObject *object, static void xnlp_monitor_label_class_init (XnlpMonitorLabelClass *klass) { - GObjectClass *class = G_OBJECT_CLASS (klass); xnlp_monitor_label_parent_class = g_type_class_peek_parent (klass); } diff --git a/panel-plugin/net.c b/panel-plugin/net.c index fde4ab1..5ed8694 100644 --- a/panel-plugin/net.c +++ b/panel-plugin/net.c @@ -178,7 +178,6 @@ int get_interface_up(netdata* data) { int sockfd; struct ifreq ifr; - struct sockaddr_in *p_sa; /* if the update count is non-zero */ if (data->up_update_count > 0) @@ -194,7 +193,7 @@ int get_interface_up(netdata* data) return FALSE; } - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name); + g_snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) != 0) { DBG("Error in ioctl(sockfd): %s", strerror(errno)); @@ -231,7 +230,7 @@ char* get_ip_address(netdata* data) return NULL; } - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name); + g_snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name); if (ioctl(sockfd, SIOCGIFADDR, &ifr) != 0) { if (errno != EADDRNOTAVAIL) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 36cf3c4..8113d17 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -181,7 +181,7 @@ static gboolean update_monitors(gpointer user_data) /* correct value to be from 1 ... 100 */ global->monitor->history[i][0] = net[i]; - if (global->monitor->history[i][0] < 0) + if ((gint) global->monitor->history[i][0] < 0) { global->monitor->history[i][0] = 0; } diff --git a/panel-plugin/os.h b/panel-plugin/os.h index 2e88f59..2db420f 100644 --- a/panel-plugin/os.h +++ b/panel-plugin/os.h @@ -50,7 +50,7 @@ # include # include # include -#elif __APPLE__ /* Mac OS X */ +#elif defined (__APPLE__) /* Mac OS X */ # include # include # include @@ -76,7 +76,7 @@ # include # include # include -#elif __DragonFly__ /* D R A G O N F L Y */ +#elif defined (__DragonFly__) /* D R A G O N F L Y */ # include # include # include @@ -98,7 +98,7 @@ # include # include # include -#elif __FreeBSD__ || __FreeBSD_kernel__ /* F R E E B S D */ +#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) /* F R E E B S D */ # include # include # include @@ -121,7 +121,7 @@ # include # include # include -#elif __NetBSD__ /* N E T B S D */ +#elif defined (__NetBSD__) /* N E T B S D */ # include # include # include @@ -146,7 +146,7 @@ # include # include # include -#elif __OpenBSD__ || __MicroBSD__ /* O P E N B S D */ +#elif defined (__OpenBSD__) || defined (__MicroBSD__) /* O P E N B S D */ # include # include # include @@ -170,7 +170,7 @@ # include # include # include -#elif __linux__ /* L I N U X */ +#elif defined (__linux__) /* L I N U X */ # include # include # include @@ -190,7 +190,7 @@ # include # include # include -#elif __Solaris__ /* S O L A R I S */ +#elif defined (__Solaris__) /* S O L A R I S */ # include # define _WIDEC_H # include diff --git a/panel-plugin/utils.c b/panel-plugin/utils.c index 0f36ae6..12c5543 100644 --- a/panel-plugin/utils.c +++ b/panel-plugin/utils.c @@ -30,6 +30,8 @@ #include #endif +#include "utils.h" + #ifndef BUFSIZ #define BUFSIZ 512 #endif @@ -119,7 +121,7 @@ char* format_byte_humanreadable(char* string, int stringsize, double number, int /* get the number of integer characters */ count = numberOfIntegerChars = ( digits > 0 - ? ( strstr( buffer, localeinfo->decimal_point ) - buffer ) + ? (unsigned int)( strstr( buffer, localeinfo->decimal_point ) - buffer ) : strlen( buffer ) );