Avoid use of goto
This commit is contained in:
parent
e5d50aca6d
commit
b541341681
1 changed files with 7 additions and 7 deletions
14
kitty/glfw.c
14
kitty/glfw.c
|
|
@ -323,17 +323,17 @@ window_focus_callback(GLFWwindow *w, int focused) {
|
|||
static int
|
||||
drop_callback(GLFWwindow *w, const char *mime, const char *data, size_t sz) {
|
||||
if (!set_callback_window(w)) return 0;
|
||||
#define RETURN(x) { global_state.callback_os_window = NULL; return x; }
|
||||
if (!data) {
|
||||
if (strcmp(mime, "text/uri-list") == 0) return 3;
|
||||
if (strcmp(mime, "text/plain;charset=utf-8") == 0) return 2;
|
||||
if (strcmp(mime, "text/plain") == 0) return 1;
|
||||
goto end;
|
||||
if (strcmp(mime, "text/uri-list") == 0) RETURN(3);
|
||||
if (strcmp(mime, "text/plain;charset=utf-8") == 0) RETURN(2);
|
||||
if (strcmp(mime, "text/plain") == 0) RETURN(1);
|
||||
RETURN(0);
|
||||
}
|
||||
WINDOW_CALLBACK(on_drop, "sy#", mime, data, (Py_ssize_t)sz);
|
||||
request_tick_callback();
|
||||
end:
|
||||
global_state.callback_os_window = NULL;
|
||||
return 0;
|
||||
RETURN(0);
|
||||
#undef RETURN
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue