mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
common: Add additional memory utilities (xzalloc() etc.)
This commit is contained in:
parent
b89f7bfc0d
commit
cb40cdc36c
35 changed files with 193 additions and 167 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/mem.h"
|
||||
#include "xbm/parse.h"
|
||||
|
||||
static uint32_t color;
|
||||
|
|
@ -37,8 +38,8 @@ parse_set_color(float *rgba)
|
|||
static void
|
||||
process_bytes(struct pixmap *pixmap, struct token *tokens)
|
||||
{
|
||||
pixmap->data = (uint32_t *)calloc(pixmap->width * pixmap->height,
|
||||
sizeof(uint32_t));
|
||||
pixmap->data = (uint32_t *)xzalloc(
|
||||
pixmap->width * pixmap->height * sizeof(uint32_t));
|
||||
struct token *t = tokens;
|
||||
for (int row = 0; row < pixmap->height; row++) {
|
||||
int byte = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue