libi3: change scalloc() signature to match calloc()
This commit is contained in:
@ -105,13 +105,13 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha
|
||||
va_start(args, format);
|
||||
(void)vasprintf(&message, format, args);
|
||||
|
||||
struct status_block *err_block = scalloc(sizeof(struct status_block));
|
||||
struct status_block *err_block = scalloc(1, sizeof(struct status_block));
|
||||
err_block->full_text = i3string_from_utf8("Error: ");
|
||||
err_block->name = sstrdup("error");
|
||||
err_block->color = sstrdup("red");
|
||||
err_block->no_separator = true;
|
||||
|
||||
struct status_block *message_block = scalloc(sizeof(struct status_block));
|
||||
struct status_block *message_block = scalloc(1, sizeof(struct status_block));
|
||||
message_block->full_text = i3string_from_utf8(message);
|
||||
message_block->name = sstrdup("error_message");
|
||||
message_block->color = sstrdup("red");
|
||||
@ -433,7 +433,7 @@ void stdin_io_first_line_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
|
||||
} else {
|
||||
/* In case of plaintext, we just add a single block and change its
|
||||
* full_text pointer later. */
|
||||
struct status_block *new_block = scalloc(sizeof(struct status_block));
|
||||
struct status_block *new_block = scalloc(1, sizeof(struct status_block));
|
||||
TAILQ_INSERT_TAIL(&statusline_head, new_block, blocks);
|
||||
read_flat_input((char *)buffer, rec);
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
|
||||
* users updating from that version and restarting i3bar before i3. */
|
||||
if (!strcmp(cur_key, "wheel_up_cmd")) {
|
||||
DLOG("wheel_up_cmd = %.*s\n", len, val);
|
||||
binding_t *binding = scalloc(sizeof(binding_t));
|
||||
binding_t *binding = scalloc(1, sizeof(binding_t));
|
||||
binding->input_code = 4;
|
||||
sasprintf(&(binding->command), "%.*s", len, val);
|
||||
TAILQ_INSERT_TAIL(&(config.bindings), binding, bindings);
|
||||
@ -157,7 +157,7 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
|
||||
* users updating from that version and restarting i3bar before i3. */
|
||||
if (!strcmp(cur_key, "wheel_down_cmd")) {
|
||||
DLOG("wheel_down_cmd = %.*s\n", len, val);
|
||||
binding_t *binding = scalloc(sizeof(binding_t));
|
||||
binding_t *binding = scalloc(1, sizeof(binding_t));
|
||||
binding->input_code = 5;
|
||||
sasprintf(&(binding->command), "%.*s", len, val);
|
||||
TAILQ_INSERT_TAIL(&(config.bindings), binding, bindings);
|
||||
@ -277,7 +277,7 @@ static int config_boolean_cb(void *params_, int val) {
|
||||
static int config_integer_cb(void *params_, long long val) {
|
||||
if (parsing_bindings) {
|
||||
if (strcmp(cur_key, "input_code") == 0) {
|
||||
binding_t *binding = scalloc(sizeof(binding_t));
|
||||
binding_t *binding = scalloc(1, sizeof(binding_t));
|
||||
binding->input_code = val;
|
||||
TAILQ_INSERT_TAIL(&(config.bindings), binding, bindings);
|
||||
|
||||
|
@ -533,7 +533,7 @@ void handle_button(xcb_button_press_event_t *event) {
|
||||
}
|
||||
|
||||
const size_t len = namelen + strlen("workspace \"\"") + 1;
|
||||
char *buffer = scalloc(len + num_quotes);
|
||||
char *buffer = scalloc(len + num_quotes, 1);
|
||||
strncpy(buffer, "workspace \"", strlen("workspace \""));
|
||||
size_t inpos, outpos;
|
||||
for (inpos = 0, outpos = strlen("workspace \"");
|
||||
@ -730,7 +730,7 @@ static void handle_client_message(xcb_client_message_event_t *event) {
|
||||
values);
|
||||
|
||||
/* send the XEMBED_EMBEDDED_NOTIFY message */
|
||||
void *event = scalloc(32);
|
||||
void *event = scalloc(32, 1);
|
||||
xcb_client_message_event_t *ev = event;
|
||||
ev->response_type = XCB_CLIENT_MESSAGE;
|
||||
ev->window = client;
|
||||
|
Reference in New Issue
Block a user