From 551464706c848526646a20b5b4172cda69f0e005 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Sun, 10 Feb 2019 00:49:27 +0000 Subject: Tweak allocation sizeof operator usage --- src/backend_libjpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend_libjpeg.c') diff --git a/src/backend_libjpeg.c b/src/backend_libjpeg.c index e83ddc3..ba3b1f9 100644 --- a/src/backend_libjpeg.c +++ b/src/backend_libjpeg.c @@ -45,7 +45,7 @@ static void source_free(struct imv_source *src) static struct imv_bitmap *to_imv_bitmap(int width, int height, void *bitmap) { - struct imv_bitmap *bmp = malloc(sizeof(struct imv_bitmap)); + struct imv_bitmap *bmp = malloc(sizeof *bmp); bmp->width = width; bmp->height = height; bmp->format = IMV_ABGR; @@ -153,7 +153,7 @@ static enum backend_result open_path(const char *path, struct imv_source **src) return BACKEND_UNSUPPORTED; } - struct imv_source *source = calloc(1, sizeof(struct imv_source)); + struct imv_source *source = calloc(1, sizeof *source); source->name = strdup(path); source->width = width; source->height = height; @@ -193,7 +193,7 @@ static enum backend_result open_memory(void *data, size_t len, struct imv_source return BACKEND_UNSUPPORTED; } - struct imv_source *source = calloc(1, sizeof(struct imv_source)); + struct imv_source *source = calloc(1, sizeof *source); source->name = strdup("-"); source->width = width; source->height = height; -- cgit v1.2.3