Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix -Werror=calloc-transposed-args by swapping calloc args #361

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions i3lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ ev_timer *start_timer(ev_timer *timer_obj, ev_tstamp timeout, ev_callback_t call
} else {
/* When there is no memory, we just don’t have a timeout. We cannot
* exit() here, since that would effectively unlock the screen. */
timer_obj = calloc(sizeof(struct ev_timer), 1);
timer_obj = calloc(1, sizeof(struct ev_timer));
if (timer_obj) {
ev_timer_init(timer_obj, callback, timeout, 0.);
ev_timer_start(main_loop, timer_obj);
Expand Down Expand Up @@ -1301,9 +1301,9 @@ int main(int argc, char *argv[]) {
auth_state = STATE_AUTH_IDLE;
redraw_screen();

struct ev_io *xcb_watcher = calloc(sizeof(struct ev_io), 1);
struct ev_check *xcb_check = calloc(sizeof(struct ev_check), 1);
struct ev_prepare *xcb_prepare = calloc(sizeof(struct ev_prepare), 1);
struct ev_io *xcb_watcher = calloc(1, sizeof(struct ev_io));
struct ev_check *xcb_check = calloc(1, sizeof(struct ev_check));
struct ev_prepare *xcb_prepare = calloc(1, sizeof(struct ev_prepare));

ev_io_init(xcb_watcher, xcb_got_event, xcb_get_file_descriptor(conn), EV_READ);
ev_io_start(main_loop, xcb_watcher);
Expand Down
Loading