diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-02-10 00:49:27 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-02-10 00:49:27 +0000 |
commit | 551464706c848526646a20b5b4172cda69f0e005 (patch) | |
tree | 44d39aead773aca821fcb51bd2ce18372ba99d10 /src/backend_librsvg.c | |
parent | a306cd551640286eb1ad189e87bf7815b5a94de8 (diff) | |
download | imv-551464706c848526646a20b5b4172cda69f0e005.tar.gz |
Tweak allocation sizeof operator usage
Diffstat (limited to 'src/backend_librsvg.c')
-rw-r--r-- | src/backend_librsvg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend_librsvg.c b/src/backend_librsvg.c index c9a91ff..86cbf00 100644 --- a/src/backend_librsvg.c +++ b/src/backend_librsvg.c @@ -36,7 +36,7 @@ static void source_free(struct imv_source *src) static struct imv_bitmap *to_imv_bitmap(GdkPixbuf *bitmap) { - struct imv_bitmap *bmp = malloc(sizeof(struct imv_bitmap)); + struct imv_bitmap *bmp = malloc(sizeof *bmp); bmp->width = gdk_pixbuf_get_width(bitmap); bmp->height = gdk_pixbuf_get_height(bitmap); bmp->format = IMV_ARGB; @@ -141,11 +141,11 @@ static enum backend_result open_path(const char *path, struct imv_source **src) return BACKEND_UNSUPPORTED; } - struct private *private = malloc(sizeof(struct private)); + struct private *private = malloc(sizeof *private); private->data = NULL; private->len = 0; - struct imv_source *source = calloc(1, sizeof(struct imv_source)); + struct imv_source *source = calloc(1, sizeof *source); source->name = strdup(path); source->width = 1024; @@ -174,11 +174,11 @@ static enum backend_result open_memory(void *data, size_t len, struct imv_source return BACKEND_UNSUPPORTED; } - struct private *private = malloc(sizeof(struct private)); + struct private *private = malloc(sizeof *private); private->data = data; private->len = len; - struct imv_source *source = calloc(1, sizeof(struct imv_source)); + struct imv_source *source = calloc(1, sizeof *source); source->name = strdup("-"); source->width = 1024; |