Fix warnings

Fix warnings reported with -Dwarning_level=2.
This commit is contained in:
Romain Vimont 2019-11-26 09:08:12 +01:00
parent 6abb8fd0cd
commit 31d9d56117
3 changed files with 8 additions and 6 deletions

View file

@ -23,7 +23,7 @@ receiver_destroy(struct receiver *receiver) {
} }
static void static void
process_msg(struct receiver *receiver, struct device_msg *msg) { process_msg(struct device_msg *msg) {
switch (msg->type) { switch (msg->type) {
case DEVICE_MSG_TYPE_CLIPBOARD: case DEVICE_MSG_TYPE_CLIPBOARD:
LOGI("Device clipboard copied"); LOGI("Device clipboard copied");
@ -33,7 +33,7 @@ process_msg(struct receiver *receiver, struct device_msg *msg) {
} }
static ssize_t static ssize_t
process_msgs(struct receiver *receiver, const unsigned char *buf, size_t len) { process_msgs(const unsigned char *buf, size_t len) {
size_t head = 0; size_t head = 0;
for (;;) { for (;;) {
struct device_msg msg; struct device_msg msg;
@ -45,7 +45,7 @@ process_msgs(struct receiver *receiver, const unsigned char *buf, size_t len) {
return head; return head;
} }
process_msg(receiver, &msg); process_msg(&msg);
device_msg_destroy(&msg); device_msg_destroy(&msg);
head += r; head += r;
@ -72,7 +72,7 @@ run_receiver(void *data) {
break; break;
} }
ssize_t consumed = process_msgs(receiver, buf, r); ssize_t consumed = process_msgs(buf, r);
if (consumed == -1) { if (consumed == -1) {
// an error occurred // an error occurred
break; break;

View file

@ -201,6 +201,7 @@ handle_event(SDL_Event *event, bool control) {
static bool static bool
event_loop(bool display, bool control) { event_loop(bool display, bool control) {
(void) display;
#ifdef CONTINUOUS_RESIZING_WORKAROUND #ifdef CONTINUOUS_RESIZING_WORKAROUND
if (display) { if (display) {
SDL_AddEventWatch(event_watcher, NULL); SDL_AddEventWatch(event_watcher, NULL);
@ -256,6 +257,7 @@ sdl_priority_from_av_level(int level) {
static void static void
av_log_callback(void *avcl, int level, const char *fmt, va_list vl) { av_log_callback(void *avcl, int level, const char *fmt, va_list vl) {
(void) avcl;
SDL_LogPriority priority = sdl_priority_from_av_level(level); SDL_LogPriority priority = sdl_priority_from_av_level(level);
if (priority == 0) { if (priority == 0) {
return; return;

View file

@ -185,8 +185,8 @@ screen_init_rendering(struct screen *screen, const char *window_title,
window_flags |= SDL_WINDOW_BORDERLESS; window_flags |= SDL_WINDOW_BORDERLESS;
} }
int x = window_x != -1 ? window_x : SDL_WINDOWPOS_UNDEFINED; int x = window_x != -1 ? window_x : (int) SDL_WINDOWPOS_UNDEFINED;
int y = window_y != -1 ? window_y : SDL_WINDOWPOS_UNDEFINED; int y = window_y != -1 ? window_y : (int) SDL_WINDOWPOS_UNDEFINED;
screen->window = SDL_CreateWindow(window_title, x, y, screen->window = SDL_CreateWindow(window_title, x, y,
window_size.width, window_size.height, window_size.width, window_size.height,
window_flags); window_flags);