Change return type of two functions

`on_application_reopen()` and `intercept_cocoa_fullscreen()` both only have two possible return values and can therefore have a return type of `bool`.
This commit is contained in:
Luflosi
2019-11-24 13:01:54 +01:00
parent 0f46ce49e2
commit e0edef6719
4 changed files with 10 additions and 10 deletions

View File

@@ -67,9 +67,9 @@ typedef void* CVDisplayLinkRef;
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int, unsigned long); typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int, unsigned long);
typedef int (* GLFWapplicationshouldhandlereopenfun)(int); typedef bool (* GLFWapplicationshouldhandlereopenfun)(int);
typedef void (* GLFWapplicationwillfinishlaunchingfun)(void); typedef void (* GLFWapplicationwillfinishlaunchingfun)(void);
typedef int (* GLFWcocoatogglefullscreenfun)(GLFWwindow*); typedef bool (* GLFWcocoatogglefullscreenfun)(GLFWwindow*);
typedef void (* GLFWcocoarenderframefun)(GLFWwindow*); typedef void (* GLFWcocoarenderframefun)(GLFWwindow*);
typedef struct VkMacOSSurfaceCreateInfoMVK typedef struct VkMacOSSurfaceCreateInfoMVK

View File

@@ -200,9 +200,9 @@ const char *action_text, int32_t timeout, GLFWDBusnotificationcreatedfun callbac
{} {}
typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int,unsigned long); typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int,unsigned long);
typedef int (* GLFWapplicationshouldhandlereopenfun)(int); typedef bool (* GLFWapplicationshouldhandlereopenfun)(int);
typedef void (* GLFWapplicationwillfinishlaunchingfun)(void); typedef void (* GLFWapplicationwillfinishlaunchingfun)(void);
typedef int (* GLFWcocoatogglefullscreenfun)(GLFWwindow*); typedef bool (* GLFWcocoatogglefullscreenfun)(GLFWwindow*);
typedef void (* GLFWcocoarenderframefun)(GLFWwindow*); typedef void (* GLFWcocoarenderframefun)(GLFWwindow*);
typedef void (*GLFWwaylandframecallbackfunc)(unsigned long long id); typedef void (*GLFWwaylandframecallbackfunc)(unsigned long long id);
typedef void (*GLFWDBusnotificationcreatedfun)(unsigned long long, uint32_t, void*); typedef void (*GLFWDBusnotificationcreatedfun)(unsigned long long, uint32_t, void*);

4
kitty/glfw-wrapper.h generated
View File

@@ -1575,9 +1575,9 @@ typedef struct GLFWgamepadstate
typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int,unsigned long); typedef int (* GLFWcocoatextinputfilterfun)(int,int,unsigned int,unsigned long);
typedef int (* GLFWapplicationshouldhandlereopenfun)(int); typedef bool (* GLFWapplicationshouldhandlereopenfun)(int);
typedef void (* GLFWapplicationwillfinishlaunchingfun)(void); typedef void (* GLFWapplicationwillfinishlaunchingfun)(void);
typedef int (* GLFWcocoatogglefullscreenfun)(GLFWwindow*); typedef bool (* GLFWcocoatogglefullscreenfun)(GLFWwindow*);
typedef void (* GLFWcocoarenderframefun)(GLFWwindow*); typedef void (* GLFWcocoarenderframefun)(GLFWwindow*);
typedef void (*GLFWwaylandframecallbackfunc)(unsigned long long id); typedef void (*GLFWwaylandframecallbackfunc)(unsigned long long id);
typedef void (*GLFWDBusnotificationcreatedfun)(unsigned long long, uint32_t, void*); typedef void (*GLFWDBusnotificationcreatedfun)(unsigned long long, uint32_t, void*);

View File

@@ -461,19 +461,19 @@ filter_option(int key UNUSED, int mods, unsigned int native_key UNUSED, unsigned
static GLFWwindow *application_quit_canary = NULL; static GLFWwindow *application_quit_canary = NULL;
static int static bool
on_application_reopen(int has_visible_windows) { on_application_reopen(int has_visible_windows) {
if (has_visible_windows) return true; if (has_visible_windows) return true;
set_cocoa_pending_action(NEW_OS_WINDOW, NULL); set_cocoa_pending_action(NEW_OS_WINDOW, NULL);
return false; return false;
} }
static int static bool
intercept_cocoa_fullscreen(GLFWwindow *w) { intercept_cocoa_fullscreen(GLFWwindow *w) {
if (!OPT(macos_traditional_fullscreen) || !set_callback_window(w)) return 0; if (!OPT(macos_traditional_fullscreen) || !set_callback_window(w)) return false;
toggle_fullscreen_for_os_window(global_state.callback_os_window); toggle_fullscreen_for_os_window(global_state.callback_os_window);
global_state.callback_os_window = NULL; global_state.callback_os_window = NULL;
return 1; return true;
} }
#endif #endif