mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 17:13:02 +01:00
Fix unused variable warnings and change all (void)s to UNUSED macro
This commit is contained in:
parent
46513017e3
commit
ddc8c53abf
@ -28,6 +28,7 @@
|
||||
|
||||
#include "line_info.h"
|
||||
#include "settings.h"
|
||||
#include "misc_tools.h"
|
||||
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
@ -456,7 +457,7 @@ void *thread_poll(void *arg) // TODO: maybe use thread for every input source
|
||||
/*
|
||||
* NOTE: We only need to poll input devices for data.
|
||||
*/
|
||||
(void)arg;
|
||||
UNUSED_VAR(arg);
|
||||
uint32_t i;
|
||||
int32_t sample = 0;
|
||||
|
||||
|
@ -901,7 +901,7 @@ static void init_infobox(ToxWindow *self)
|
||||
return;
|
||||
}
|
||||
|
||||
(void) y2;
|
||||
UNUSED_VAR(y2);
|
||||
|
||||
memset(&ctx->infobox, 0, sizeof(struct infobox));
|
||||
|
||||
@ -1011,6 +1011,8 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
getyx(self->window, y, x);
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
UNUSED_VAR(y);
|
||||
|
||||
if (y2 <= 0 || x2 <= 0) {
|
||||
return;
|
||||
}
|
||||
@ -1239,7 +1241,9 @@ static void chat_onDraw(ToxWindow *self, Tox *m)
|
||||
|
||||
int y, x;
|
||||
getyx(self->window, y, x);
|
||||
(void) x;
|
||||
|
||||
UNUSED_VAR(x);
|
||||
|
||||
int new_x = ctx->start ? x2 - 1 : MAX(0, wcswidth(ctx->line, ctx->pos));
|
||||
wmove(self->window, y + 1, new_x);
|
||||
|
||||
|
@ -488,6 +488,8 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
getyx(self->window, y, x);
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
UNUSED_VAR(y);
|
||||
|
||||
if (x2 <= 0 || y2 <= 0) {
|
||||
return;
|
||||
}
|
||||
@ -666,7 +668,9 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
|
||||
|
||||
int y, x;
|
||||
getyx(self->window, y, x);
|
||||
(void) x;
|
||||
|
||||
UNUSED_VAR(x);
|
||||
|
||||
int new_x = ctx->start ? x2 - 1 : MAX(0, wcswidth(ctx->line, ctx->pos));
|
||||
wmove(self->window, y + 1, new_x);
|
||||
|
||||
|
@ -138,7 +138,8 @@ static void help_draw_bottom_menu(WINDOW *win)
|
||||
{
|
||||
int y2, x2;
|
||||
getmaxyx(win, y2, x2);
|
||||
(void) x2;
|
||||
|
||||
UNUSED_VAR(x2);
|
||||
|
||||
wmove(win, y2 - 2, 1);
|
||||
|
||||
|
@ -270,7 +270,8 @@ static void line_info_check_queue(ToxWindow *self)
|
||||
int y, y2, x, x2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
getyx(self->chatwin->history, y, x);
|
||||
(void) x;
|
||||
|
||||
UNUSED_VAR(x);
|
||||
|
||||
if (x2 <= SIDEBAR_WIDTH) {
|
||||
return;
|
||||
@ -567,7 +568,9 @@ static void line_info_page_up(ToxWindow *self, struct history *hst)
|
||||
{
|
||||
int x2, y2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
(void) x2;
|
||||
|
||||
UNUSED_VAR(x2);
|
||||
|
||||
int jump_dist = y2 / 2;
|
||||
int i;
|
||||
|
||||
@ -580,7 +583,9 @@ static void line_info_page_down(ToxWindow *self, struct history *hst)
|
||||
{
|
||||
int x2, y2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
(void) x2;
|
||||
|
||||
UNUSED_VAR(x2);
|
||||
|
||||
int jump_dist = y2 / 2;
|
||||
int i;
|
||||
|
||||
|
@ -235,7 +235,7 @@ void graceful_clear(void)
|
||||
|
||||
void *do_playing(void *_p)
|
||||
{
|
||||
(void)_p;
|
||||
UNUSED_VAR(_p);
|
||||
|
||||
while (true) {
|
||||
control_lock();
|
||||
@ -334,7 +334,7 @@ int play_source(uint32_t source, uint32_t buffer, bool looping)
|
||||
#elif BOX_NOTIFY
|
||||
void *do_playing(void *_p)
|
||||
{
|
||||
(void)_p;
|
||||
UNUSED_VAR(_p);
|
||||
|
||||
while (true) {
|
||||
control_lock();
|
||||
|
@ -220,6 +220,8 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
getyx(self->window, y, x);
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
UNUSED_VAR(y);
|
||||
|
||||
if (x2 <= 0 || y2 <= 0) {
|
||||
return;
|
||||
}
|
||||
@ -416,7 +418,8 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
|
||||
|
||||
int y, x;
|
||||
getyx(self->window, y, x);
|
||||
(void) x;
|
||||
|
||||
UNUSED_VAR(x);
|
||||
|
||||
int new_x = ctx->start ? x2 - 1 : MAX(0, wcswidth(ctx->line, ctx->pos));
|
||||
wmove(self->window, y + 1, new_x);
|
||||
@ -508,7 +511,7 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m, bool first_time_run)
|
||||
exit_toxic_err("failed in prompt_init_statusbar", FATALERR_CURSES);
|
||||
}
|
||||
|
||||
(void) y2;
|
||||
UNUSED_VAR(y2);
|
||||
|
||||
/* Init statusbar info */
|
||||
StatusBar *statusbar = self->stb;
|
||||
|
@ -662,7 +662,7 @@ void *video_thread_poll(void *arg) // TODO: maybe use thread for every input so
|
||||
/*
|
||||
* NOTE: We only need to poll input devices for data.
|
||||
*/
|
||||
(void)arg;
|
||||
UNUSED_VAR(arg);
|
||||
uint32_t i;
|
||||
|
||||
while (1) {
|
||||
|
@ -232,7 +232,7 @@ void *event_loop(void *p)
|
||||
{
|
||||
/* Handle events like a real nigga */
|
||||
|
||||
(void) p; /* DINDUNOTHIN */
|
||||
UNUSED_VAR(p); /* DINDUNOTHIN */
|
||||
|
||||
XEvent event;
|
||||
int pending;
|
||||
|
Loading…
Reference in New Issue
Block a user