set_nonblock(client);
- struct ev_io *package = calloc(sizeof(struct ev_io), 1);
+ struct ev_io *package = scalloc(sizeof(struct ev_io));
ev_io_init(package, ipc_receive_message, client, EV_READ);
ev_io_start(EV_A_ package);
DLOG("IPC: new client connected\n");
- struct ipc_client *new = calloc(sizeof(struct ipc_client), 1);
+ struct ipc_client *new = scalloc(sizeof(struct ipc_client));
new->fd = client;
TAILQ_INSERT_TAIL(&all_clients, new, clients);
LOG("Managing window 0x%08x\n", child);
DLOG("x = %d, y = %d, width = %d, height = %d\n", x, y, width, height);
- new = calloc(sizeof(Client), 1);
+ new = scalloc(sizeof(Client));
new->force_reconfigure = true;
/* Update the data structures */
static void new_container(Workspace *workspace, Container **container, int col, int row, bool skip_layout_switch) {
Container *new;
- new = *container = calloc(sizeof(Container), 1);
+ new = *container = scalloc(sizeof(Container));
CIRCLEQ_INIT(&(new->clients));
new->colspan = 1;
new->rowspan = 1;
workspace->width_factor[workspace->cols-1] = 0;
workspace->table = realloc(workspace->table, sizeof(Container**) * workspace->cols);
- workspace->table[workspace->cols-1] = calloc(sizeof(Container*) * workspace->rows, 1);
+ workspace->table[workspace->cols-1] = scalloc(sizeof(Container*) * workspace->rows);
for (int c = 0; c < workspace->rows; c++)
new_container(workspace, &(workspace->table[workspace->cols-1][c]), workspace->cols-1, c, true);
workspace->width_factor[0] = 0;
workspace->table = realloc(workspace->table, sizeof(Container**) * workspace->cols);
- workspace->table[workspace->cols-1] = calloc(sizeof(Container*) * workspace->rows, 1);
+ workspace->table[workspace->cols-1] = scalloc(sizeof(Container*) * workspace->rows);
/* Move the other columns */
for (int rows = 0; rows < workspace->rows; rows++)