aboutsummaryrefslogtreecommitdiff
path: root/src/backend_freeimage.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-02-10 00:49:27 +0000
committerHarry Jeffery <harry@exec64.co.uk>2019-02-10 00:49:27 +0000
commit551464706c848526646a20b5b4172cda69f0e005 (patch)
tree44d39aead773aca821fcb51bd2ce18372ba99d10 /src/backend_freeimage.c
parenta306cd551640286eb1ad189e87bf7815b5a94de8 (diff)
downloadimv-551464706c848526646a20b5b4172cda69f0e005.tar.gz
Tweak allocation sizeof operator usage
Diffstat (limited to 'src/backend_freeimage.c')
-rw-r--r--src/backend_freeimage.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend_freeimage.c b/src/backend_freeimage.c
index c0fb655..bb3c089 100644
--- a/src/backend_freeimage.c
+++ b/src/backend_freeimage.c
@@ -50,7 +50,7 @@ static void source_free(struct imv_source *src)
static struct imv_bitmap *to_imv_bitmap(FIBITMAP *in_bmp)
{
- struct imv_bitmap *bmp = malloc(sizeof(struct imv_bitmap));
+ struct imv_bitmap *bmp = malloc(sizeof *bmp);
bmp->width = FreeImage_GetWidth(in_bmp);
bmp->height = FreeImage_GetHeight(in_bmp);
bmp->format = IMV_ARGB;
@@ -277,10 +277,10 @@ static enum backend_result open_path(const char *path, struct imv_source **src)
return BACKEND_UNSUPPORTED;
}
- struct private *private = calloc(sizeof(struct private), 1);
+ struct private *private = calloc(1, sizeof(struct private));
private->format = fmt;
- struct imv_source *source = calloc(sizeof(struct imv_source), 1);
+ struct imv_source *source = calloc(1, sizeof *source);
source->name = strdup(path);
source->width = 0;
source->height = 0;
@@ -308,11 +308,11 @@ static enum backend_result open_memory(void *data, size_t len, struct imv_source
return BACKEND_UNSUPPORTED;
}
- struct private *private = calloc(sizeof(struct private), 1);
+ struct private *private = calloc(1, sizeof(struct private));
private->format = fmt;
private->memory = fmem;
- struct imv_source *source = calloc(sizeof(struct imv_source), 1);
+ struct imv_source *source = calloc(1, sizeof *source);
source->name = NULL;
source->width = 0;
source->height = 0;