diff options
author | pisculichi <pisculichi@openmailbox.com> | 2016-05-02 16:01:48 +0000 |
---|---|---|
committer | pisculichi <pisculichi@openmailbox.com> | 2016-05-03 15:28:20 +0000 |
commit | 47e792da05f79c624a190fd5780e07f171fd7bd1 (patch) | |
tree | cfe0e053c3dac6cc933901309810809216ecc20a /src | |
parent | cf98260eded9150d4ce1f3c5184ae5f3463d9c21 (diff) | |
download | irssi-47e792da05f79c624a190fd5780e07f171fd7bd1.zip |
Fix some ANSI C issues.
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-messages.c | 5 | ||||
-rw-r--r-- | src/fe-common/core/themes.c | 2 | ||||
-rw-r--r-- | src/fe-text/gui-entry.c | 9 | ||||
-rw-r--r-- | src/fe-text/gui-readline.c | 3 | ||||
-rw-r--r-- | src/fe-text/statusbar.c | 2 | ||||
-rw-r--r-- | src/irc/proxy/proxy.c | 3 |
6 files changed, 15 insertions, 9 deletions
diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index 3240fd10..bc2a30d6 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -175,6 +175,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg, int for_me, print_channel, level; char *nickmode, *color, *freemsg = NULL; HILIGHT_REC *hilight; + TEXT_DEST_REC dest; /* NOTE: this may return NULL if some channel is just closed with /WINDOW CLOSE and server still sends the few last messages */ @@ -214,7 +215,6 @@ static void sig_message_public(SERVER_REC *server, const char *msg, if (printnick == NULL) printnick = nick; - TEXT_DEST_REC dest; format_create_dest(&dest, server, target, level, NULL); dest.address = address; dest.nick = nick; @@ -396,8 +396,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick, count = 0; windows = NULL; chans = g_string_new(NULL); for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { + CHANNEL_REC *rec; level = MSGLEVEL_QUITS; - CHANNEL_REC *rec = tmp->data; + rec = tmp->data; if (!nicklist_find(rec, nick)) continue; diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index 58e7b557..2b1459be 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -365,9 +365,9 @@ char *theme_format_expand_get(THEME_REC *theme, const char **format) GString *str; char *ret; theme_rm_col dummy, reset; + int braces = 1; /* we start with one brace opened */ dummy.m[0] = '\0'; strcpy(reset.m, "n"); - int braces = 1; /* we start with one brace opened */ str = g_string_new(NULL); while (**format != '\0' && braces != 0) { diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 63dda34e..31fe0e1e 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -554,6 +554,7 @@ void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr) char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) { + GUI_ENTRY_CUTBUFFER_REC *tmp; char *buf; int i; @@ -562,7 +563,7 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) if (entry->kill_ring == NULL || entry->kill_ring->data == NULL) return NULL; - GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data; + tmp = entry->kill_ring->data; if (tmp->cutbuffer == NULL) return NULL; @@ -582,12 +583,14 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) char *gui_entry_get_next_cutbuffer(GUI_ENTRY_REC *entry) { + GUI_ENTRY_CUTBUFFER_REC *tmp; + g_return_val_if_fail(entry != NULL, NULL); if (entry->kill_ring == NULL) return NULL; - GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data; + tmp = entry->kill_ring->data; entry->kill_ring = g_slist_remove(entry->kill_ring, tmp); entry->kill_ring = g_slist_append(entry->kill_ring, tmp); @@ -608,7 +611,7 @@ void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, CUTBUFFER_UPDATE_OP updat static GUI_ENTRY_CUTBUFFER_REC *get_cutbuffer_rec(GUI_ENTRY_REC *entry, CUTBUFFER_UPDATE_OP update_cutbuffer) { - GUI_ENTRY_CUTBUFFER_REC *tmp = NULL; + GUI_ENTRY_CUTBUFFER_REC *tmp; g_return_val_if_fail(entry != NULL, NULL); diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index e0ffb4f1..7c71edd7 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -696,10 +696,11 @@ static void key_append_next_kill(void) static gboolean paste_timeout(gpointer data) { + int split_lines; paste_was_bracketed_mode = paste_bracketed_mode; /* number of lines after splitting extra-long messages */ - int split_lines = paste_buffer->len / LINE_SPLIT_LIMIT; + split_lines = paste_buffer->len / LINE_SPLIT_LIMIT; /* Take into account the fact that a line may be split every LINE_SPLIT_LIMIT characters */ if (paste_line_count == 0 && split_lines <= paste_verify_line_count) { diff --git a/src/fe-text/statusbar.c b/src/fe-text/statusbar.c index 5448243a..f0dff828 100644 --- a/src/fe-text/statusbar.c +++ b/src/fe-text/statusbar.c @@ -671,8 +671,8 @@ void statusbar_item_default_handler(SBAR_ITEM_REC *item, int get_size_only, WI_ITEM_REC *wiitem; char *tmpstr, *tmpstr2; theme_rm_col reset; - strcpy(reset.m, "n"); int len; + strcpy(reset.m, "n"); if (str == NULL) str = statusbar_item_get_value(item); diff --git a/src/irc/proxy/proxy.c b/src/irc/proxy/proxy.c index 1a714045..2875d2c2 100644 --- a/src/irc/proxy/proxy.c +++ b/src/irc/proxy/proxy.c @@ -28,13 +28,14 @@ /* SYNTAX: IRSSIPROXY STATUS */ static void cmd_irssiproxy_status(const char *data, IRC_SERVER_REC *server) { + GSList *tmp; + if (!settings_get_bool("irssiproxy")) { printtext(server, NULL, MSGLEVEL_CLIENTNOTICE, "Proxy is currently disabled"); return; } - GSList *tmp; printtext(server, NULL, MSGLEVEL_CLIENTNOTICE, "Proxy: Currently connected clients: %d", |