Add void to all function declarations for functions that take no arguments

Micro-optimization for some architectures. Enforced via
-Wstrict-prototypes
This commit is contained in:
Kovid Goyal 2019-05-13 10:59:01 +05:30
parent 3e964163c0
commit 4fff84b4b9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
26 changed files with 78 additions and 76 deletions

View File

@ -21,7 +21,7 @@
#endif
static inline double
monotonic() {
monotonic(void) {
struct timespec ts = {0};
#ifdef CLOCK_HIGHRES
clock_gettime(CLOCK_HIGHRES, &ts);

View File

@ -223,7 +223,7 @@ void _glfwPollMonitorsNS(void);
void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor);
float _glfwTransformYNS(float y);
void _glfwClearDisplayLinks();
void _glfwClearDisplayLinks(void);
void _glfwCocoaPostEmptyEvent(short subtype, long data1, bool at_start);
void _glfwDispatchTickCallback();
void _glfwDispatchTickCallback(void);
void _glfwDispatchRenderFrame(CGDirectDisplayID);

2
glfw/dbus_glfw.c vendored
View File

@ -314,7 +314,7 @@ glfw_dbus_match_signal(DBusMessage *msg, const char *interface, ...) {
}
static void
glfw_dbus_connect_to_session_bus() {
glfw_dbus_connect_to_session_bus(void) {
DBusError error;
dbus_error_init(&error);
if (session_bus) {

4
glfw/dbus_glfw.h vendored
View File

@ -48,7 +48,7 @@ glfw_dbus_call_method_no_reply(DBusConnection *conn, const char *node, const cha
GLFWbool
glfw_dbus_call_method_with_reply(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, int timeout_ms, dbus_pending_callback callback, void *user_data, ...);
void glfw_dbus_dispatch(DBusConnection *);
void glfw_dbus_session_bus_dispatch();
void glfw_dbus_session_bus_dispatch(void);
GLFWbool glfw_dbus_get_args(DBusMessage *msg, const char *failmsg, ...);
int glfw_dbus_match_signal(DBusMessage *msg, const char *interface, ...);
DBusConnection* glfw_dbus_session_bus();
DBusConnection* glfw_dbus_session_bus(void);

View File

@ -134,6 +134,8 @@ def __init__(self, declaration, check_fail=True):
if a == 'void':
continue
self.args.append(Arg(a))
if not self.args:
self.args = [Arg('void v')]
def declaration(self):
return 'typedef {restype} (*{name}_func)({args});\n{name}_func {name}_impl;\n#define {name} {name}_impl'.format(
@ -233,7 +235,7 @@ def generate_wrappers(glfw_header):
}
void
unload_glfw() {
unload_glfw(void) {
if (handle) { dlclose(handle); handle = NULL; }
}
'''.replace('LOAD', '\n\n '.join(f.load() for f in functions))

4
glfw/internal.h vendored
View File

@ -793,10 +793,10 @@ void _glfwCenterCursorInContentArea(_GLFWwindow* window);
GLFWbool _glfwInitVulkan(int mode);
void _glfwTerminateVulkan(void);
const char* _glfwGetVulkanResultString(VkResult result);
_GLFWwindow* _glfwFocusedWindow();
_GLFWwindow* _glfwFocusedWindow(void);
_GLFWwindow* _glfwWindowForId(GLFWid id);
void _glfwPlatformRunMainLoop(GLFWtickcallback, void*);
void _glfwPlatformRequestTickCallback();
void _glfwPlatformRequestTickCallback(void);
void _glfwPlatformStopMainLoop(void);
unsigned long long _glfwPlatformAddTimer(double interval, bool repeats, GLFWuserdatafun callback, void *callback_data, GLFWuserdatafun free_callback);
void _glfwPlatformUpdateTimer(unsigned long long timer_id, double interval, GLFWbool enabled);

4
glfw/wl_platform.h vendored
View File

@ -317,7 +317,7 @@ typedef struct _GLFWcursorWayland
void _glfwAddOutputWayland(uint32_t name, uint32_t version);
void _glfwSetupWaylandDataDevice();
void _glfwSetupWaylandPrimarySelectionDevice();
void _glfwSetupWaylandDataDevice(void);
void _glfwSetupWaylandPrimarySelectionDevice(void);
void animateCursorImage(id_type timer_id, void *data);
struct wl_cursor* _glfwLoadCursor(GLFWCursorShape);

8
glfw/wl_window.c vendored
View File

@ -126,7 +126,7 @@ static void resizeFramebuffer(_GLFWwindow* window)
static const char*
clipboard_mime() {
clipboard_mime(void) {
static char buf[128] = {0};
if (buf[0] == 0) {
snprintf(buf, sizeof(buf), "application/glfw+clipboard-%d", getpid());
@ -1558,7 +1558,7 @@ const static struct zwp_primary_selection_source_v1_listener primary_selection_s
.cancelled = primary_selection_source_canceled,
};
static void prune_unclaimed_data_offers() {
static void prune_unclaimed_data_offers(void) {
for (size_t i = 0; i < arraysz(_glfw.wl.dataOffers); i++) {
if (_glfw.wl.dataOffers[i].id && !_glfw.wl.dataOffers[i].offer_type) {
wl_data_offer_destroy(_glfw.wl.dataOffers[i].id);
@ -1567,7 +1567,7 @@ static void prune_unclaimed_data_offers() {
}
}
static void prune_unclaimed_primary_selection_offers() {
static void prune_unclaimed_primary_selection_offers(void) {
for (size_t i = 0; i < arraysz(_glfw.wl.primarySelectionOffers); i++) {
if (_glfw.wl.primarySelectionOffers[i].id && !_glfw.wl.dataOffers[i].offer_type) {
zwp_primary_selection_offer_v1_destroy(_glfw.wl.primarySelectionOffers[i].id);
@ -1799,7 +1799,7 @@ void _glfwSetupWaylandPrimarySelectionDevice() {
if (_glfw.wl.primarySelectionDevice) zwp_primary_selection_device_v1_add_listener(_glfw.wl.primarySelectionDevice, &primary_selection_device_listener, NULL);
}
static inline GLFWbool _glfwEnsureDataDevice() {
static inline GLFWbool _glfwEnsureDataDevice(void) {
if (!_glfw.wl.dataDeviceManager)
{
_glfwInputError(GLFW_PLATFORM_ERROR,

2
glfw/x11_window.c vendored
View File

@ -1053,7 +1053,7 @@ static void releaseMonitor(_GLFWwindow* window)
}
}
static void onConfigChange()
static void onConfigChange(void)
{
float xscale, yscale;
_glfwGetSystemContentScaleX11(&xscale, &yscale, GLFW_TRUE);

View File

@ -76,7 +76,7 @@ void* free_workspace(void *v);
double score_item(void *v, text_t *haystack, len_t haystack_len, len_t *match_positions);
unsigned int encode_codepoint(text_t ch, char* dest);
size_t unescape(const char *src, char *dest, size_t destlen);
int cpu_count();
int cpu_count(void);
void* alloc_threads(size_t num_threads);
#ifdef ISWINDOWS
bool start_thread(void* threads, size_t i, unsigned int (STDCALL *start_routine) (void *), void *arg);

View File

@ -747,7 +747,7 @@ monitor_pid(PyObject *self UNUSED, PyObject *args) {
}
static inline void
report_reaped_pids() {
report_reaped_pids(void) {
children_mutex(lock);
if (reaped_pids_count) {
for (size_t i = 0; i < reaped_pids_count; i++) {
@ -852,7 +852,7 @@ process_pending_resizes(double now) {
}
static inline void
close_all_windows() {
close_all_windows(void) {
for (size_t w = 0; w < global_state.num_os_windows; w++) mark_os_window_for_close(&global_state.os_windows[w], true);
}
@ -1391,7 +1391,7 @@ remove_poll_fd(int fd) {
}
static inline void
prune_finished_reads() {
prune_finished_reads(void) {
if (!talk_data.num_reads) return;
for (ssize_t i = talk_data.num_reads - 1; i >= 0; i--) {
PeerReadData *rd = talk_data.reads + i;
@ -1409,7 +1409,7 @@ prune_finished_reads() {
}
static inline void
prune_finished_writes() {
prune_finished_writes(void) {
if (!talk_data.num_writes) return;
for (ssize_t i = talk_data.num_writes - 1; i >= 0; i--) {
PeerWriteData *wd = talk_data.writes + i;
@ -1439,7 +1439,7 @@ wakeup_talk_loop(bool in_signal_handler) {
}
static inline void
move_queued_writes() {
move_queued_writes(void) {
while (talk_data.num_queued_writes) {
PeerWriteData *src = talk_data.queued_writes + --talk_data.num_queued_writes;
size_t fd_idx = talk_data.num_listen_fds + talk_data.num_talk_fds;

View File

@ -31,7 +31,7 @@ static uint32_t FG_BG_256[256] = {
};
static inline void
init_FG_BG_table() {
init_FG_BG_table(void) {
if (UNLIKELY(FG_BG_256[255] == 0)) {
// colors 16..232: the 6x6x6 color cube
const uint8_t valuerange[6] = {0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff};

View File

@ -44,7 +44,7 @@
#include <mach/mach_time.h>
static mach_timebase_info_data_t timebase = {0};
static inline double monotonic_() {
static inline double monotonic_(void) {
return ((double)(mach_absolute_time() * timebase.numer) / timebase.denom)/SEC_TO_NS;
}
@ -76,7 +76,7 @@ process_group_map() {
#else
#include <time.h>
static inline double monotonic_() {
static inline double monotonic_(void) {
struct timespec ts = {0};
#ifdef CLOCK_HIGHRES
clock_gettime(CLOCK_HIGHRES, &ts);

View File

@ -266,12 +266,12 @@ typedef struct {FONTS_DATA_HEAD} *FONTS_DATA_HANDLE;
// Global functions
const char* base64_decode(const uint32_t *src, size_t src_sz, uint8_t *dest, size_t dest_capacity, size_t *dest_sz);
Line* alloc_line();
Cursor* alloc_cursor();
Line* alloc_line(void);
Cursor* alloc_cursor(void);
LineBuf* alloc_linebuf(unsigned int, unsigned int);
HistoryBuf* alloc_historybuf(unsigned int, unsigned int, unsigned int);
ColorProfile* alloc_color_profile();
PyObject* create_256_color_table();
ColorProfile* alloc_color_profile(void);
PyObject* create_256_color_table(void);
PyObject* parse_bytes_dump(PyObject UNUSED *, PyObject *);
PyObject* parse_bytes(PyObject UNUSED *, PyObject *);
void cursor_reset(Cursor*);
@ -283,7 +283,7 @@ void apply_sgr_to_cells(GPUCell *first_cell, unsigned int cell_count, unsigned i
const char* cell_as_sgr(GPUCell *, GPUCell *);
const char* cursor_as_sgr(const Cursor *);
double monotonic();
double monotonic(void);
PyObject* cm_thread_write(PyObject *self, PyObject *args);
bool schedule_write_to_child(unsigned long id, unsigned int num, ...);
bool set_iutf8(int, bool);
@ -295,9 +295,9 @@ void colorprofile_push_dynamic_colors(ColorProfile*);
void colorprofile_pop_dynamic_colors(ColorProfile*);
void set_mouse_cursor(MouseShape);
void enter_event();
void enter_event(void);
void mouse_event(int, int, int);
void focus_in_event();
void focus_in_event(void);
void wakeup_io_loop(bool);
void scroll_event(double, double, int);
void fake_scroll(int, bool);

View File

@ -98,7 +98,7 @@ static id_type font_group_id_counter = 0;
static void initialize_font_group(FontGroup *fg);
static inline void
save_window_font_groups() {
save_window_font_groups(void) {
for (size_t o = 0; o < global_state.num_os_windows; o++) {
OSWindow *w = global_state.os_windows + o;
w->temp_font_group_id = w->fonts_data ? ((FontGroup*)(w->fonts_data))->id : 0;
@ -106,7 +106,7 @@ save_window_font_groups() {
}
static inline void
restore_window_font_groups() {
restore_window_font_groups(void) {
for (size_t o = 0; o < global_state.num_os_windows; o++) {
OSWindow *w = global_state.os_windows + o;
w->fonts_data = NULL;
@ -129,7 +129,7 @@ font_group_is_unused(FontGroup *fg) {
}
static inline void
trim_unused_font_groups() {
trim_unused_font_groups(void) {
save_window_font_groups();
size_t i = 0;
while (i < num_font_groups) {
@ -143,7 +143,7 @@ trim_unused_font_groups() {
}
static inline void
add_font_group() {
add_font_group(void) {
if (num_font_groups) trim_unused_font_groups();
if (num_font_groups >= font_groups_capacity) {
save_window_font_groups();
@ -369,7 +369,7 @@ del_font_group(FontGroup *fg) {
}
static inline void
free_font_groups() {
free_font_groups(void) {
if (font_groups) {
for (size_t i = 0; i < num_font_groups; i++) del_font_group(font_groups + i);
free(font_groups); font_groups = NULL;
@ -928,7 +928,7 @@ shape_run(CPUCell *first_cpu_cell, GPUCell *first_gpu_cell, index_type num_cells
}
static inline void
merge_groups_for_pua_space_ligature() {
merge_groups_for_pua_space_ligature(void) {
while (G(group_idx) > 0) {
Group *g = G(groups), *g1 = G(groups) + 1;
g->num_cells += g1->num_cells;
@ -1129,7 +1129,7 @@ render_simple_text(FONTS_DATA_HANDLE fg_, const char *text) {
}
static inline void
clear_symbol_maps() {
clear_symbol_maps(void) {
if (symbol_maps) { free(symbol_maps); symbol_maps = NULL; num_symbol_maps = 0; }
}

View File

@ -649,7 +649,7 @@ PyTypeObject Face_Type = {
};
static void
free_freetype() {
free_freetype(void) {
FT_Done_FreeType(library);
}

View File

@ -179,7 +179,7 @@ bind_program(int program) {
}
static inline void
unbind_program() {
unbind_program(void) {
glUseProgram(0);
}
// }}}
@ -262,7 +262,7 @@ typedef struct {
static VAO vaos[4*MAX_CHILDREN + 10] = {{0}};
static ssize_t
create_vao() {
create_vao(void) {
GLuint vao_id;
glGenVertexArrays(1, &vao_id);
for (size_t i = 0; i < sizeof(vaos)/sizeof(vaos[0]); i++) {
@ -340,7 +340,7 @@ bind_vertex_array(ssize_t vao_idx) {
}
static void
unbind_vertex_array() {
unbind_vertex_array(void) {
glBindVertexArray(0);
}

2
kitty/glfw-wrapper.c generated
View File

@ -416,6 +416,6 @@ load_glfw(const char* path) {
}
void
unload_glfw() {
unload_glfw(void) {
if (handle) { dlclose(handle); handle = NULL; }
}

28
kitty/glfw-wrapper.h generated
View File

@ -1408,7 +1408,7 @@ typedef void (* GLFWcocoarenderframefun)(GLFWwindow*);
typedef void (*GLFWwaylandframecallbackfunc)(unsigned long long id);
typedef void (*GLFWDBusnotificationcreatedfun)(unsigned long long, uint32_t, void*);
typedef void (*GLFWDBusnotificationactivatedfun)(uint32_t, const char*);
typedef int (*glfwInit_func)();
typedef int (*glfwInit_func)(void);
glfwInit_func glfwInit_impl;
#define glfwInit glfwInit_impl
@ -1416,11 +1416,11 @@ typedef void (*glfwRunMainLoop_func)(GLFWtickcallback, void*);
glfwRunMainLoop_func glfwRunMainLoop_impl;
#define glfwRunMainLoop glfwRunMainLoop_impl
typedef void (*glfwStopMainLoop_func)();
typedef void (*glfwStopMainLoop_func)(void);
glfwStopMainLoop_func glfwStopMainLoop_impl;
#define glfwStopMainLoop glfwStopMainLoop_impl
typedef void (*glfwRequestTickCallback_func)();
typedef void (*glfwRequestTickCallback_func)(void);
glfwRequestTickCallback_func glfwRequestTickCallback_impl;
#define glfwRequestTickCallback glfwRequestTickCallback_impl
@ -1436,7 +1436,7 @@ typedef void (*glfwRemoveTimer_func)(unsigned long);
glfwRemoveTimer_func glfwRemoveTimer_impl;
#define glfwRemoveTimer glfwRemoveTimer_impl
typedef void (*glfwTerminate_func)();
typedef void (*glfwTerminate_func)(void);
glfwTerminate_func glfwTerminate_impl;
#define glfwTerminate glfwTerminate_impl
@ -1448,7 +1448,7 @@ typedef void (*glfwGetVersion_func)(int*, int*, int*);
glfwGetVersion_func glfwGetVersion_impl;
#define glfwGetVersion glfwGetVersion_impl
typedef const char* (*glfwGetVersionString_func)();
typedef const char* (*glfwGetVersionString_func)(void);
glfwGetVersionString_func glfwGetVersionString_impl;
#define glfwGetVersionString glfwGetVersionString_impl
@ -1464,7 +1464,7 @@ typedef GLFWmonitor** (*glfwGetMonitors_func)(int*);
glfwGetMonitors_func glfwGetMonitors_impl;
#define glfwGetMonitors glfwGetMonitors_impl
typedef GLFWmonitor* (*glfwGetPrimaryMonitor_func)();
typedef GLFWmonitor* (*glfwGetPrimaryMonitor_func)(void);
glfwGetPrimaryMonitor_func glfwGetPrimaryMonitor_impl;
#define glfwGetPrimaryMonitor glfwGetPrimaryMonitor_impl
@ -1520,7 +1520,7 @@ typedef void (*glfwSetGammaRamp_func)(GLFWmonitor*, const GLFWgammaramp*);
glfwSetGammaRamp_func glfwSetGammaRamp_impl;
#define glfwSetGammaRamp glfwSetGammaRamp_impl
typedef void (*glfwDefaultWindowHints_func)();
typedef void (*glfwDefaultWindowHints_func)(void);
glfwDefaultWindowHints_func glfwDefaultWindowHints_impl;
#define glfwDefaultWindowHints glfwDefaultWindowHints_impl
@ -1704,7 +1704,7 @@ typedef GLFWwindowcontentscalefun (*glfwSetWindowContentScaleCallback_func)(GLFW
glfwSetWindowContentScaleCallback_func glfwSetWindowContentScaleCallback_impl;
#define glfwSetWindowContentScaleCallback glfwSetWindowContentScaleCallback_impl
typedef void (*glfwPostEmptyEvent_func)();
typedef void (*glfwPostEmptyEvent_func)(void);
glfwPostEmptyEvent_func glfwPostEmptyEvent_impl;
#define glfwPostEmptyEvent glfwPostEmptyEvent_impl
@ -1848,7 +1848,7 @@ typedef const char* (*glfwGetClipboardString_func)(GLFWwindow*);
glfwGetClipboardString_func glfwGetClipboardString_impl;
#define glfwGetClipboardString glfwGetClipboardString_impl
typedef double (*glfwGetTime_func)();
typedef double (*glfwGetTime_func)(void);
glfwGetTime_func glfwGetTime_impl;
#define glfwGetTime glfwGetTime_impl
@ -1856,11 +1856,11 @@ typedef void (*glfwSetTime_func)(double);
glfwSetTime_func glfwSetTime_impl;
#define glfwSetTime glfwSetTime_impl
typedef uint64_t (*glfwGetTimerValue_func)();
typedef uint64_t (*glfwGetTimerValue_func)(void);
glfwGetTimerValue_func glfwGetTimerValue_impl;
#define glfwGetTimerValue glfwGetTimerValue_impl
typedef uint64_t (*glfwGetTimerFrequency_func)();
typedef uint64_t (*glfwGetTimerFrequency_func)(void);
glfwGetTimerFrequency_func glfwGetTimerFrequency_impl;
#define glfwGetTimerFrequency glfwGetTimerFrequency_impl
@ -1868,7 +1868,7 @@ typedef void (*glfwMakeContextCurrent_func)(GLFWwindow*);
glfwMakeContextCurrent_func glfwMakeContextCurrent_impl;
#define glfwMakeContextCurrent glfwMakeContextCurrent_impl
typedef GLFWwindow* (*glfwGetCurrentContext_func)();
typedef GLFWwindow* (*glfwGetCurrentContext_func)(void);
glfwGetCurrentContext_func glfwGetCurrentContext_impl;
#define glfwGetCurrentContext glfwGetCurrentContext_impl
@ -1888,7 +1888,7 @@ typedef GLFWglproc (*glfwGetProcAddress_func)(const char*);
glfwGetProcAddress_func glfwGetProcAddress_impl;
#define glfwGetProcAddress glfwGetProcAddress_impl
typedef int (*glfwVulkanSupported_func)();
typedef int (*glfwVulkanSupported_func)(void);
glfwVulkanSupported_func glfwVulkanSupported_impl;
#define glfwVulkanSupported glfwVulkanSupported_impl
@ -1928,7 +1928,7 @@ typedef void (*glfwCocoaRequestRenderFrame_func)(GLFWwindow*, GLFWcocoarenderfra
glfwCocoaRequestRenderFrame_func glfwCocoaRequestRenderFrame_impl;
#define glfwCocoaRequestRenderFrame glfwCocoaRequestRenderFrame_impl
typedef void* (*glfwGetX11Display_func)();
typedef void* (*glfwGetX11Display_func)(void);
glfwGetX11Display_func glfwGetX11Display_impl;
#define glfwGetX11Display glfwGetX11Display_impl

View File

@ -84,7 +84,7 @@ set_callback_window(GLFWwindow *w) {
}
static inline bool
is_window_ready_for_callbacks() {
is_window_ready_for_callbacks(void) {
OSWindow *w = global_state.callback_os_window;
if (w->num_tabs == 0) return false;
Tab *t = w->tabs + w->active_tab;

View File

@ -82,7 +82,7 @@ typedef struct {
bool has_margins;
} ScrollData;
GraphicsManager* grman_alloc();
GraphicsManager* grman_alloc(void);
void grman_clear(GraphicsManager*, bool, CellPixelSize fg);
const char* grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty, CellPixelSize fg);
bool grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float screen_left, float screen_top, float dx, float dy, unsigned int num_cols, unsigned int num_rows, CellPixelSize);

View File

@ -50,7 +50,7 @@ set_special_key_combo(int glfw_key, int mods, bool is_native) {
}
static inline Window*
active_window() {
active_window(void) {
Tab *t = global_state.callback_os_window->tabs + global_state.callback_os_window->active_tab;
Window *w = t->windows + t->active_window;
if (w->render_data.screen) return w;

View File

@ -405,7 +405,7 @@ HANDLER(handle_button_event) {
}
static inline int
currently_pressed_button() {
currently_pressed_button(void) {
for (int i = 0; i < GLFW_MOUSE_BUTTON_5; i++) {
if (global_state.callback_os_window->mouse_button_pressed[i]) return i;
}

View File

@ -157,7 +157,7 @@ static GLuint offscreen_framebuffer = 0;
static ssize_t blit_vertex_array;
static void
init_cell_program() {
init_cell_program(void) {
for (int i = CELL_PROGRAM; i < BORDERS_PROGRAM; i++) {
cell_program_layouts[i].render_data.index = block_index(i, "CellRenderData");
cell_program_layouts[i].render_data.size = block_size(i, cell_program_layouts[i].render_data.index);
@ -531,7 +531,7 @@ enum BorderUniforms { BORDER_viewport, BORDER_background_opacity, BORDER_default
static GLint border_uniform_locations[NUM_BORDER_UNIFORMS] = {0};
static void
init_borders_program() {
init_borders_program(void) {
Program *p = programs + BORDERS_PROGRAM;
int left = NUM_BORDER_UNIFORMS;
for (int i = 0; i < p->num_of_uniforms; i++, left--) {
@ -549,7 +549,7 @@ init_borders_program() {
}
ssize_t
create_border_vao() {
create_border_vao(void) {
ssize_t vao_idx = create_vao();
add_buffer_to_vao(vao_idx, GL_ARRAY_BUFFER);

View File

@ -181,16 +181,16 @@ extern GlobalState global_state;
else Py_DECREF(cret_); \
}
void gl_init();
void gl_init(void);
void remove_vao(ssize_t vao_idx);
bool remove_os_window(id_type os_window_id);
void make_os_window_context_current(OSWindow *w);
void update_os_window_references();
void update_os_window_references(void);
void mark_os_window_for_close(OSWindow* w, bool yes);
void update_os_window_viewport(OSWindow *window, bool);
bool should_os_window_close(OSWindow* w);
bool should_os_window_be_rendered(OSWindow* w);
void wakeup_main_loop();
void wakeup_main_loop(void);
void swap_window_buffers(OSWindow *w);
void make_window_context_current(OSWindow *w);
void hide_mouse(OSWindow *w);
@ -199,14 +199,14 @@ void destroy_os_window(OSWindow *w);
void focus_os_window(OSWindow *w, bool also_raise);
void set_os_window_title(OSWindow *w, const char *title);
OSWindow* os_window_for_kitty_window(id_type);
OSWindow* add_os_window();
OSWindow* current_os_window();
OSWindow* add_os_window(void);
OSWindow* current_os_window(void);
void os_window_regions(OSWindow*, Region *main, Region *tab_bar);
bool drag_scroll(Window *, OSWindow*);
void draw_borders(ssize_t vao_idx, unsigned int num_border_rects, BorderRect *rect_buf, bool rect_data_is_dirty, uint32_t viewport_width, uint32_t viewport_height, color_type, unsigned int, OSWindow *w);
ssize_t create_cell_vao();
ssize_t create_graphics_vao();
ssize_t create_border_vao();
ssize_t create_cell_vao(void);
ssize_t create_graphics_vao(void);
ssize_t create_border_vao(void);
bool send_cell_data_to_gpu(ssize_t, ssize_t, float, float, float, float, Screen *, OSWindow *);
void draw_cells(ssize_t, ssize_t, float, float, float, float, Screen *, OSWindow *, bool, bool);
void draw_centered_alpha_mask(ssize_t gvao_idx, size_t screen_width, size_t screen_height, size_t width, size_t height, uint8_t *canvas);
@ -228,8 +228,8 @@ typedef enum {
NEW_TAB_WITH_WD = 8
} CocoaPendingAction;
void set_cocoa_pending_action(CocoaPendingAction action, const char*);
bool application_quit_requested();
void request_application_quit();
bool application_quit_requested(void);
void request_application_quit(void);
#endif
void request_frame_render(OSWindow *w);
typedef void (* timer_callback_fun)(id_type, void*);

View File

@ -205,7 +205,7 @@ def init_env(
cppflags.append('-DDEBUG_{}'.format(el.upper().replace('-', '_')))
cflags = os.environ.get(
'OVERRIDE_CFLAGS', (
'-Wextra -Wno-missing-field-initializers -Wall -std=c11'
'-Wextra -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11'
' -pedantic-errors -Werror {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
).format(
optimize,