1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Reduce scope of variables in ui/core

Not as important as the other one (where there was a double
declaration). But for the sake of consistency.
This commit is contained in:
Michael Vetter 2015-10-09 11:20:49 +02:00
parent 8dfa41ea8e
commit dd2ce7a5bf
2 changed files with 7 additions and 11 deletions

View File

@ -2582,12 +2582,9 @@ ui_handle_room_configuration_form_error(const char * const roomjid, const char *
void void
ui_handle_room_config_submit_result(const char * const roomjid) ui_handle_room_config_submit_result(const char * const roomjid)
{ {
ProfWin *muc_window = NULL;
ProfWin *form_window = NULL;
int num;
if (roomjid) { if (roomjid) {
muc_window = (ProfWin*)wins_get_muc(roomjid); ProfWin *form_window = NULL;
ProfWin *muc_window = (ProfWin*)wins_get_muc(roomjid);
GString *form_recipient = g_string_new(roomjid); GString *form_recipient = g_string_new(roomjid);
g_string_append(form_recipient, " config"); g_string_append(form_recipient, " config");
@ -2595,7 +2592,7 @@ ui_handle_room_config_submit_result(const char * const roomjid)
g_string_free(form_recipient, TRUE); g_string_free(form_recipient, TRUE);
if (form_window) { if (form_window) {
num = wins_get_num(form_window); int num = wins_get_num(form_window);
wins_close_by_num(num); wins_close_by_num(num);
} }
@ -2616,10 +2613,9 @@ void
ui_handle_room_config_submit_result_error(const char * const roomjid, const char * const message) ui_handle_room_config_submit_result_error(const char * const roomjid, const char * const message)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
ProfWin *muc_window = NULL;
ProfWin *form_window = NULL;
if (roomjid) { if (roomjid) {
ProfWin *muc_window = NULL;
ProfWin *form_window = NULL;
muc_window = (ProfWin*)wins_get_muc(roomjid); muc_window = (ProfWin*)wins_get_muc(roomjid);
GString *form_recipient = g_string_new(roomjid); GString *form_recipient = g_string_new(roomjid);

View File

@ -471,12 +471,12 @@ win_clear(ProfWin *window)
void void
win_resize(ProfWin *window) win_resize(ProfWin *window)
{ {
int subwin_cols = 0;
int cols = getmaxx(stdscr); int cols = getmaxx(stdscr);
if (window->layout->type == LAYOUT_SPLIT) { if (window->layout->type == LAYOUT_SPLIT) {
ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout; ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout;
if (layout->subwin) { if (layout->subwin) {
int subwin_cols = 0;
if (window->type == WIN_CONSOLE) { if (window->type == WIN_CONSOLE) {
subwin_cols = win_roster_cols(); subwin_cols = win_roster_cols();
} else if (window->type == WIN_MUC) { } else if (window->type == WIN_MUC) {
@ -506,11 +506,11 @@ win_update_virtual(ProfWin *window)
{ {
int rows, cols; int rows, cols;
getmaxyx(stdscr, rows, cols); getmaxyx(stdscr, rows, cols);
int subwin_cols = 0;
if (window->layout->type == LAYOUT_SPLIT) { if (window->layout->type == LAYOUT_SPLIT) {
ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout; ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout;
if (layout->subwin) { if (layout->subwin) {
int subwin_cols = 0;
if (window->type == WIN_MUC) { if (window->type == WIN_MUC) {
subwin_cols = win_occpuants_cols(); subwin_cols = win_occpuants_cols();
} else { } else {