diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-10 23:00:56 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-10 23:00:56 +0000 |
commit | dcc2e89b2e0a99645b4f49360c3b76958730563e (patch) | |
tree | 824e1fb77f05e94a3b4cb48e051728eb9bd519a3 /src/core | |
parent | f8aa81b73c83b97aff8cf24244e0bb183a35d59c (diff) | |
download | irssi-dcc2e89b2e0a99645b4f49360c3b76958730563e.zip |
Enabled lots of GCC warnings, fixed those that were easy to fix.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@456 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/levels.c | 2 | ||||
-rw-r--r-- | src/core/misc.c | 16 | ||||
-rw-r--r-- | src/core/network.c | 2 | ||||
-rw-r--r-- | src/core/signals.c | 2 |
4 files changed, 13 insertions, 9 deletions
diff --git a/src/core/levels.c b/src/core/levels.c index 207c0619..8618f340 100644 --- a/src/core/levels.c +++ b/src/core/levels.c @@ -21,7 +21,7 @@ #include "module.h" #include "levels.h" -static char *levels[] = +static const char *levels[] = { "CRAP", "MSGS", diff --git a/src/core/misc.c b/src/core/misc.c index 3a3b76bb..4922dbc0 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -168,8 +168,10 @@ int copyfile(const char *src, const char *dest) int len; char buf[1024]; - while ((len = fread(buf, 1, sizeof(buf), fs)) > 0) - if (fwrite(buf, 1, len, fd) != len) break; + while ((len = fread(buf, 1, sizeof(buf), fs)) > 0) { + if (fwrite(buf, 1, len, fd) != len) + break; + } fclose(fd); ret = TRUE; } @@ -330,8 +332,10 @@ char *stristr(const char *data, const char *key) return NULL; max = data+datalen-keylen; - for (pos = data; pos <= max; pos++) - if (g_strncasecmp(pos, key, keylen) == 0) return (char *) pos; + for (pos = data; pos <= max; pos++) { + if (g_strncasecmp(pos, key, keylen) == 0) + return (char *) pos; + } return NULL; } @@ -397,12 +401,12 @@ int g_istr_cmp(gconstpointer v, gconstpointer v2) /* a char* hash function from ASU */ unsigned int g_istr_hash(gconstpointer v) { - const char *s = (char *) v; + const char *s = (const char *) v; unsigned int h = 0, g; while (*s != '\0') { h = (h << 4) + toupper(*s); - if ((g = h & 0xf0000000)) { + if ((g = h & 0xf0000000UL)) { h = h ^ (g >> 24); h = h ^ g; } diff --git a/src/core/network.c b/src/core/network.c index 5a6e276a..42d58bb3 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -403,7 +403,7 @@ int net_ip2host(IPADDR *ip, char *host) ip4 = ntohl(ip->addr.ip.s_addr); sprintf(host, "%lu.%lu.%lu.%lu", - (ip4 & 0xff000000) >> 24, + (ip4 & 0xff000000UL) >> 24, (ip4 & 0x00ff0000) >> 16, (ip4 & 0x0000ff00) >> 8, (ip4 & 0x000000ff)); diff --git a/src/core/signals.c b/src/core/signals.c index 84cbb79d..cfc0da37 100644 --- a/src/core/signals.c +++ b/src/core/signals.c @@ -94,7 +94,7 @@ static void signal_destroy(int signal_id) static int signal_list_find(GPtrArray *array, void *data) { - int n; + unsigned int n; for (n = 0; n < array->len; n++) { if (g_ptr_array_index(array, n) == data) |