fix remove unused variables and uset getmaxx() or getmaxy() for remaining variables

This commit is contained in:
Andreas Heil 2023-05-23 10:12:00 +02:00 committed by Kaian
parent 6ea5fa4d31
commit a7b8436818
3 changed files with 8 additions and 28 deletions

View File

@ -428,7 +428,7 @@ call_flow_draw_message(ui_t *ui, call_flow_arrow_t *arrow, int cline)
address_t dst;
char method[METHOD_MAXLEN + 1];
char delta[15] = {};
int flowh, floww;
int flowh;
char mediastr[40];
sip_msg_t *msg = arrow->item;
vector_iter_t medias;
@ -436,9 +436,6 @@ call_flow_draw_message(ui_t *ui, call_flow_arrow_t *arrow, int cline)
int msglen;
int aline = cline + 1;
// quell warning about unused variables (getmaxyx is a macro)
(void)floww;
// Initialize method
memset(method, 0, sizeof(method));
@ -447,7 +444,7 @@ call_flow_draw_message(ui_t *ui, call_flow_arrow_t *arrow, int cline)
// Get the messages window
flow_win = info->flow_win;
getmaxyx(flow_win, flowh, floww);
flowh = getmaxx(flow_win);
// Store arrow start line
arrow->line = cline;
@ -676,21 +673,18 @@ call_flow_draw_rtp_stream(ui_t *ui, call_flow_arrow_t *arrow, int cline)
call_flow_info_t *info;
WINDOW *win;
char text[50], time[20];
int height, width;
int height;
rtp_stream_t *stream = arrow->item;
sip_msg_t *msg;
sip_call_t *call;
call_flow_arrow_t *msgarrow;
address_t addr;
// quell warning about unused variables (getmaxyx is a macro)
(void)width;
// Get panel information
info = call_flow_info(ui);
// Get the messages window
win = info->flow_win;
getmaxyx(win, height, width);
height = getmaxy(win);
// Store arrow start line
arrow->line = cline;
@ -1113,23 +1107,17 @@ call_flow_draw_raw_rtcp(ui_t *ui, rtp_stream_t *stream)
int
call_flow_handle_key(ui_t *ui, int key)
{
int raw_width, height, width;
int raw_width;
call_flow_info_t *info = call_flow_info(ui);
ui_t *next_ui;
sip_call_t *call = NULL, *xcall = NULL;
int rnpag_steps = setting_get_intvalue(SETTING_CF_SCROLLSTEP);
int action = -1;
// quell warnings about unused variables (getmaxyx is a macro)
(void)height;
(void)width;
// Sanity check, this should not happen
if (!info)
return KEY_NOT_HANDLED;
getmaxyx(info->flow_win, height, width);
// Check actions for this key
while ((action = key_find_action(key, action)) != ERR) {
// Check if we handle this action

View File

@ -558,7 +558,7 @@ call_list_line_text(ui_t *ui, sip_call_t *call, char *text)
int
call_list_handle_key(ui_t *ui, int key)
{
int listh, listw,rnpag_steps = setting_get_intvalue(SETTING_CL_SCROLLSTEP);
int rnpag_steps = setting_get_intvalue(SETTING_CL_SCROLLSTEP);
call_list_info_t *info;
ui_t *next_ui;
sip_call_group_t *group;
@ -566,10 +566,6 @@ call_list_handle_key(ui_t *ui, int key)
sip_call_t *call, *xcall;
sip_sort_t sort;
// quell warnings about unused variables (getmaxyx is a macro)
(void)listh;
(void)listw;
// Sanity check, this should not happen
if (!(info = call_list_info(ui)))
return -1;
@ -583,7 +579,6 @@ call_list_handle_key(ui_t *ui, int key)
// Get window of call list panel
WINDOW *list_win = info->list_win;
getmaxyx(list_win, listh, listw);
// Check actions for this key
while ((action = key_find_action(key, action)) != ERR) {

View File

@ -592,12 +592,9 @@ dialog_progress_run(const char *fmt, ...)
void
dialog_progress_set_value(WINDOW *win, int perc)
{
int height, width;
int width;
// quell warning about unused variables (getmaxyx is a macro)
(void)height;
getmaxyx(win, height, width);
width = getmaxx(win);
mvwhline(win, 4, 4, '-', width - 10);
mvwaddch(win, 4, 3, '[');
mvwaddch(win, 4, width - 7, ']');