[warnings] fix cert-err33-c

Fix unused return values, cast to void if on purpose
This commit is contained in:
akallabeth
2024-08-26 15:39:33 +02:00
parent 7503efed27
commit 1d33095500
172 changed files with 1146 additions and 1080 deletions

View File

@@ -54,7 +54,7 @@ static void data_offer_offer(void* data, struct wl_data_offer* data_offer,
else
{
event->seat = seat;
snprintf(event->mime, sizeof(event->mime), "%s", offered_mime_type);
(void)snprintf(event->mime, sizeof(event->mime), "%s", offered_mime_type);
}
}
}

View File

@@ -56,7 +56,7 @@ static bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code
{
va_list args;
va_start(args, msg);
vfprintf(stderr, "%s", args);
(void)vfprintf(stderr, "%s", args);
va_end(args);
return false;
}
@@ -402,7 +402,8 @@ UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err)
if (ret->display == NULL)
{
fprintf(stderr, "failed to connect to Wayland display %s: %s\n", name, strerror(errno));
(void)fprintf(stderr, "failed to connect to Wayland display %s: %s\n", name,
strerror(errno));
*err = UWAC_ERROR_UNABLE_TO_CONNECT;
goto out_free;
}

View File

@@ -75,8 +75,8 @@ static struct wl_buffer* create_pointer_buffer(UwacSeat* seat, const void* src,
wl_shm_pool_destroy(pool);
if (munmap(data, size) < 0)
fprintf(stderr, "%s: munmap(%p, %zu) failed with [%d] %s\n", __func__, data, size, errno,
strerror(errno));
(void)fprintf(stderr, "%s: munmap(%p, %zu) failed with [%d] %s\n", __func__, data, size,
errno, strerror(errno));
error_mmap:
close(fd);
@@ -1103,7 +1103,7 @@ UwacSeat* UwacSeatNew(UwacDisplay* d, uint32_t id, uint32_t version)
ret->xkb_context = xkb_context_new(0);
if (!ret->xkb_context)
{
fprintf(stderr, "%s: unable to allocate a xkb_context\n", __func__);
(void)fprintf(stderr, "%s: unable to allocate a xkb_context\n", __func__);
goto fail;
}
@@ -1114,13 +1114,13 @@ UwacSeat* UwacSeatNew(UwacDisplay* d, uint32_t id, uint32_t version)
ret->repeat_timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
if (ret->repeat_timer_fd < 0)
{
fprintf(stderr, "%s: error creating repeat timer\n", __func__);
(void)fprintf(stderr, "%s: error creating repeat timer\n", __func__);
goto fail;
}
ret->repeat_task.run = keyboard_repeat_func;
if (UwacDisplayWatchFd(d, ret->repeat_timer_fd, EPOLLIN, &ret->repeat_task) < 0)
{
fprintf(stderr, "%s: error polling repeat timer\n", __func__);
(void)fprintf(stderr, "%s: error polling repeat timer\n", __func__);
goto fail;
}

View File

@@ -258,7 +258,7 @@ int uwac_create_anonymous_file(off_t size)
if (!name)
return -1;
snprintf(name, length, "%s%s", path, template);
(void)snprintf(name, length, "%s%s", path, template);
fd = create_tmpfile_cloexec(name);
free(name);
}

View File

@@ -39,7 +39,7 @@ static void* fail_on_null(void* p)
{
if (p == NULL)
{
fprintf(stderr, "out of memory\n");
(void)fprintf(stderr, "out of memory\n");
exit(EXIT_FAILURE);
}