1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-05 05:28:32 +00:00

More warning fixes.

This commit is contained in:
Brenden Matthews 2018-12-22 13:16:38 -05:00
parent 8ff1d9845d
commit 41c32bb72f
No known key found for this signature in database
GPG Key ID: 60FBD122E62B0D30
5 changed files with 22 additions and 20 deletions

View File

@ -1646,9 +1646,10 @@ int draw_each_line_inner(char *s, int special_index, int last_special_applied) {
char *tmp_str; char *tmp_str;
cur_x += font_ascent() / 2; cur_x += font_ascent() / 2;
cur_y += font_h / 2; cur_y += font_h / 2;
asprintf(&tmp_str, "%.1f", current->scale); if (asprintf(&tmp_str, "%.1f", current->scale)) {
draw_string(tmp_str); draw_string(tmp_str);
free(tmp_str); free(tmp_str);
}
cur_x = tmp_x; cur_x = tmp_x;
cur_y = tmp_y; cur_y = tmp_y;
} }
@ -2685,10 +2686,11 @@ void load_config_file() {
l.call(1, 1); l.call(1, 1);
#else #else
char *syntaxerr; char *syntaxerr;
asprintf(&syntaxerr, _(SYNTAX_ERR_READ_CONF), e.what()); if (asprintf(&syntaxerr, _(SYNTAX_ERR_READ_CONF), e.what())) {
std::string syntaxerrobj(syntaxerr); std::string syntaxerrobj(syntaxerr);
free(syntaxerr); free(syntaxerr);
throw conky::error(syntaxerrobj); throw conky::error(syntaxerrobj);
}
#endif #endif
} }
l.call(0, 0); l.call(0, 0);

View File

@ -680,9 +680,9 @@ int update_net_stats(void) {
// get essid // get essid
if (winfo->b.has_essid) { if (winfo->b.has_essid) {
if (winfo->b.essid_on) { if (winfo->b.essid_on) {
snprintf(ns->essid, 32, "%s", winfo->b.essid); snprintf(ns->essid, 34, "%s", winfo->b.essid);
} else { } else {
snprintf(ns->essid, 32, "%s", "off/any"); snprintf(ns->essid, 34, "%s", "off/any");
} }
} }
// get channel and freq // get channel and freq

View File

@ -30,9 +30,9 @@
#ifndef _NET_STAT_H #ifndef _NET_STAT_H
#define _NET_STAT_H #define _NET_STAT_H
#include "config.h"
#include <sys/socket.h> /* struct sockaddr */
#include <netinet/in.h> /* struct in6_addr */ #include <netinet/in.h> /* struct in6_addr */
#include <sys/socket.h> /* struct sockaddr */
#include "config.h"
#ifdef BUILD_IPV6 #ifdef BUILD_IPV6
struct v6addr { struct v6addr {
@ -73,7 +73,7 @@ struct net_stat {
* trans_speed */ * trans_speed */
double net_rec[15], net_trans[15]; double net_rec[15], net_trans[15];
// wireless extensions // wireless extensions
char essid[32]; char essid[35];
int channel; int channel;
char freq[16]; char freq[16];
char bitrate[16]; char bitrate[16];

View File

@ -66,10 +66,10 @@ inline size_t callback_base::get_hash(const handle &h) { return h->hash; }
inline bool callback_base::is_equal(const handle &a, const handle &b) { inline bool callback_base::is_equal(const handle &a, const handle &b) {
if (a->hash != b->hash) { return false; } if (a->hash != b->hash) { return false; }
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression" #pragma clang diagnostic ignored "-Wpotentially-evaluated-expression"
if (typeid(*a) != typeid(*b)) { return false; } if (typeid(*a) != typeid(*b)) { return false; }
#pragma GCC diagnostic pop #pragma clang diagnostic pop
return *a == *b; return *a == *b;
} }

View File

@ -32,12 +32,12 @@
#include "conky.h" #include "conky.h"
#include "logging.h" #include "logging.h"
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-register" #pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma GCC diagnostic ignored "-Wregister" #pragma clang diagnostic ignored "-Wregister"
#pragma GCC diagnostic ignored "-Wvariadic-macros" #pragma clang diagnostic ignored "-Wvariadic-macros"
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xmd.h> #include <X11/Xmd.h>