mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 16:42:26 +00:00
cleanup: Use void for zero-parameter functions
Signed-off-by: Genki Sky <sky@genki.is>
This commit is contained in:
parent
41e53d1499
commit
d1cf9acbd5
@ -96,7 +96,7 @@ not use GNU extensions.
|
|||||||
Brackets always go on the same line, including in functions.
|
Brackets always go on the same line, including in functions.
|
||||||
Always include brackets for if/while/for, even if it's a single statement.
|
Always include brackets for if/while/for, even if it's a single statement.
|
||||||
```c
|
```c
|
||||||
void function() {
|
void function(void) {
|
||||||
if (condition1) {
|
if (condition1) {
|
||||||
do_thing1();
|
do_thing1();
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ static void draw(void) {
|
|||||||
demo.last_frame = ts;
|
demo.last_frame = ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_popup() {
|
static void draw_popup(void) {
|
||||||
static float alpha_mod = -0.01;
|
static float alpha_mod = -0.01;
|
||||||
|
|
||||||
eglMakeCurrent(egl.display, popup_egl_surface, popup_egl_surface, egl.context);
|
eglMakeCurrent(egl.display, popup_egl_surface, popup_egl_surface, egl.context);
|
||||||
@ -188,7 +188,7 @@ static void xdg_popup_configure(void *data, struct xdg_popup *xdg_popup,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void popup_destroy() {
|
static void popup_destroy(void) {
|
||||||
wlr_egl_destroy_surface(&egl, popup_egl_surface);
|
wlr_egl_destroy_surface(&egl, popup_egl_surface);
|
||||||
wl_egl_window_destroy(popup_egl_window);
|
wl_egl_window_destroy(popup_egl_window);
|
||||||
xdg_popup_destroy(popup);
|
xdg_popup_destroy(popup);
|
||||||
|
@ -143,7 +143,7 @@ void new_input_notify(struct wl_listener *listener, void *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
wlr_log_init(L_DEBUG, NULL);
|
wlr_log_init(L_DEBUG, NULL);
|
||||||
struct wl_display *display = wl_display_create();
|
struct wl_display *display = wl_display_create();
|
||||||
struct sample_state state = {
|
struct sample_state state = {
|
||||||
|
@ -84,7 +84,7 @@ static void gles2_scissor(struct wlr_renderer *wlr_renderer,
|
|||||||
POP_GLES2_DEBUG;
|
POP_GLES2_DEBUG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_quad() {
|
static void draw_quad(void) {
|
||||||
GLfloat verts[] = {
|
GLfloat verts[] = {
|
||||||
1, 0, // top right
|
1, 0, // top right
|
||||||
0, 0, // top left
|
0, 0, // top left
|
||||||
|
@ -56,7 +56,7 @@ struct wlr_cursor_state {
|
|||||||
struct wl_listener layout_destroy;
|
struct wl_listener layout_destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_cursor *wlr_cursor_create() {
|
struct wlr_cursor *wlr_cursor_create(void) {
|
||||||
struct wlr_cursor *cur = calloc(1, sizeof(struct wlr_cursor));
|
struct wlr_cursor *cur = calloc(1, sizeof(struct wlr_cursor));
|
||||||
if (!cur) {
|
if (!cur) {
|
||||||
wlr_log(L_ERROR, "Failed to allocate wlr_cursor");
|
wlr_log(L_ERROR, "Failed to allocate wlr_cursor");
|
||||||
|
@ -25,7 +25,7 @@ struct wlr_output_layout_output_state {
|
|||||||
struct wl_listener output_destroy;
|
struct wl_listener output_destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_output_layout *wlr_output_layout_create() {
|
struct wlr_output_layout *wlr_output_layout_create(void) {
|
||||||
struct wlr_output_layout *layout =
|
struct wlr_output_layout *layout =
|
||||||
calloc(1, sizeof(struct wlr_output_layout));
|
calloc(1, sizeof(struct wlr_output_layout));
|
||||||
if (layout == NULL) {
|
if (layout == NULL) {
|
||||||
|
@ -570,7 +570,7 @@ struct wlr_surface *wlr_surface_from_resource(struct wl_resource *resource) {
|
|||||||
return wl_resource_get_user_data(resource);
|
return wl_resource_get_user_data(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wlr_surface_state *surface_state_create() {
|
static struct wlr_surface_state *surface_state_create(void) {
|
||||||
struct wlr_surface_state *state =
|
struct wlr_surface_state *state =
|
||||||
calloc(1, sizeof(struct wlr_surface_state));
|
calloc(1, sizeof(struct wlr_surface_state));
|
||||||
if (state == NULL) {
|
if (state == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user