diff options
author | RichardHitt <rbh00@netcom.com> | 2013-01-19 12:33:16 -0800 |
---|---|---|
committer | RichardHitt <rbh00@netcom.com> | 2013-01-19 12:33:16 -0800 |
commit | 4e0daf047ed14e54ea7eeb2c1547cbe06332fbf4 (patch) | |
tree | c224e85b7ebb5a6c9854211dc7f11924a3ca2b0e /plugins | |
parent | a46f89998c4faa4b4768e18333ec98c5107ba90b (diff) |
Correct almost all compiler warning issues
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/checksum/checksum.c | 14 | ||||
-rw-r--r-- | plugins/python/python.c | 1 | ||||
-rw-r--r-- | plugins/sysinfo/parse.c | 8 |
3 files changed, 15 insertions, 8 deletions
diff --git a/plugins/checksum/checksum.c b/plugins/checksum/checksum.c index 6eb85e77..a4cadc19 100644 --- a/plugins/checksum/checksum.c +++ b/plugins/checksum/checksum.c @@ -170,22 +170,24 @@ dccrecv_cb (char *word[], void *userdata) int result; struct stat buffer; /* buffer for storing file info */ char sum[65]; /* buffer for checksum */ - char *file; + const char *file; + char *cfile; + if (hexchat_get_prefs (ph, "dcc_completed_dir", &file, NULL) == 1 && file[0] != 0) { - file = g_strconcat (file, G_DIR_SEPARATOR_S, word[1], NULL); + cfile = g_strconcat (file, G_DIR_SEPARATOR_S, word[1], NULL); } else { - file = g_strdup(word[2]); + cfile = g_strdup(word[2]); } - result = stat (file, &buffer); + result = stat (cfile, &buffer); if (result == 0) /* stat returns 0 on success */ { if (buffer.st_size <= (unsigned long long) get_limit () * 1048576) { - sha256_file (file, sum); /* file is the full filename even if completed dir set */ + sha256_file (cfile, sum); /* file is the full filename even if completed dir set */ /* try to print the checksum in the privmsg tab of the sender */ hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3])); hexchat_printf (ph, "SHA-256 checksum for %s (local): %s\n", word[1], sum); @@ -201,7 +203,7 @@ dccrecv_cb (char *word[], void *userdata) hexchat_printf (ph, "File access error!\n"); } - g_free (file); + g_free (cfile); return HEXCHAT_EAT_NONE; } diff --git a/plugins/python/python.c b/plugins/python/python.c index 2e298c35..5f98c6c7 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -66,6 +66,7 @@ #endif #include "hexchat-plugin.h" +#undef _POSIX_C_SOURCE /* Avoid warning: also in /usr/include/features.hfrom glib.h */ #include "Python.h" #include "structmember.h" #include "pythread.h" diff --git a/plugins/sysinfo/parse.c b/plugins/sysinfo/parse.c index c1b478f8..76002900 100644 --- a/plugins/sysinfo/parse.c +++ b/plugins/sysinfo/parse.c @@ -37,9 +37,13 @@ int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count) { - char buffer[bsize], *pos; +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__alpha__) || defined(__ia64__) || defined(__parisc__) || defined(__sparc__) + char buffer[bsize]; +#endif +#if defined(__powerpc__) + char *pos = NULL; +#endif FILE *fp = fopen("/proc/cpuinfo", "r"); - pos = NULL; if(fp == NULL) return 1; if(count != NULL) *count = 0; |