mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
selection: don't do "return function_returning_void()" in functions returning void
This commit is contained in:
parent
9db78c3122
commit
74cf8e0206
1 changed files with 22 additions and 11 deletions
33
selection.c
33
selection.c
|
|
@ -184,10 +184,12 @@ foreach_selected(
|
||||||
{
|
{
|
||||||
switch (term->selection.kind) {
|
switch (term->selection.kind) {
|
||||||
case SELECTION_NORMAL:
|
case SELECTION_NORMAL:
|
||||||
return foreach_selected_normal(term, start, end, cb, data);
|
foreach_selected_normal(term, start, end, cb, data);
|
||||||
|
return;
|
||||||
|
|
||||||
case SELECTION_BLOCK:
|
case SELECTION_BLOCK:
|
||||||
return foreach_selected_block(term, start, end, cb, data);
|
foreach_selected_block(term, start, end, cb, data);
|
||||||
|
return;
|
||||||
|
|
||||||
case SELECTION_NONE:
|
case SELECTION_NONE:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
@ -1059,7 +1061,8 @@ begin_receive_clipboard(struct terminal *term, int read_fd,
|
||||||
{
|
{
|
||||||
LOG_ERRNO("failed to set O_NONBLOCK");
|
LOG_ERRNO("failed to set O_NONBLOCK");
|
||||||
close(read_fd);
|
close(read_fd);
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct clipboard_receive *ctx = xmalloc(sizeof(*ctx));
|
struct clipboard_receive *ctx = xmalloc(sizeof(*ctx));
|
||||||
|
|
@ -1082,14 +1085,17 @@ text_from_clipboard(struct seat *seat, struct terminal *term,
|
||||||
void (*done)(void *user), void *user)
|
void (*done)(void *user), void *user)
|
||||||
{
|
{
|
||||||
struct wl_clipboard *clipboard = &seat->clipboard;
|
struct wl_clipboard *clipboard = &seat->clipboard;
|
||||||
if (clipboard->data_offer == NULL)
|
if (clipboard->data_offer == NULL) {
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Prepare a pipe the other client can write its selection to us */
|
/* Prepare a pipe the other client can write its selection to us */
|
||||||
int fds[2];
|
int fds[2];
|
||||||
if (pipe2(fds, O_CLOEXEC) == -1) {
|
if (pipe2(fds, O_CLOEXEC) == -1) {
|
||||||
LOG_ERRNO("failed to create pipe");
|
LOG_ERRNO("failed to create pipe");
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int read_fd = fds[0];
|
int read_fd = fds[0];
|
||||||
|
|
@ -1197,18 +1203,23 @@ text_from_primary(
|
||||||
void (*cb)(const char *data, size_t size, void *user),
|
void (*cb)(const char *data, size_t size, void *user),
|
||||||
void (*done)(void *user), void *user)
|
void (*done)(void *user), void *user)
|
||||||
{
|
{
|
||||||
if (term->wl->primary_selection_device_manager == NULL)
|
if (term->wl->primary_selection_device_manager == NULL) {
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct wl_primary *primary = &seat->primary;
|
struct wl_primary *primary = &seat->primary;
|
||||||
if (primary->data_offer == NULL)
|
if (primary->data_offer == NULL){
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Prepare a pipe the other client can write its selection to us */
|
/* Prepare a pipe the other client can write its selection to us */
|
||||||
int fds[2];
|
int fds[2];
|
||||||
if (pipe2(fds, O_CLOEXEC) == -1) {
|
if (pipe2(fds, O_CLOEXEC) == -1) {
|
||||||
LOG_ERRNO("failed to create pipe");
|
LOG_ERRNO("failed to create pipe");
|
||||||
return done(user);
|
done(user);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int read_fd = fds[0];
|
int read_fd = fds[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue