common: Add znew/znew_n() macros

This commit is contained in:
John Lindgren 2022-09-18 15:22:26 -04:00
parent da57483961
commit a54d378e6c
26 changed files with 47 additions and 47 deletions

View file

@ -38,8 +38,7 @@ parse_set_color(float *rgba)
static void
process_bytes(struct pixmap *pixmap, struct token *tokens)
{
pixmap->data = (uint32_t *)xzalloc(
pixmap->width * pixmap->height * sizeof(uint32_t));
pixmap->data = znew_n(uint32_t, pixmap->width * pixmap->height);
struct token *t = tokens;
for (int row = 0; row < pixmap->height; row++) {
int byte = 1;