From bca4219dd0c8c1896a19ed5544b40656f5078b1b Mon Sep 17 00:00:00 2001 From: Bruno George de Moraes Date: Thu, 4 Sep 2014 20:44:51 -0300 Subject: malloc+memset(0) to calloc Signed-off-by: wm4 --- TOOLS/vf_dlopen/framestep.c | 3 +-- TOOLS/vf_dlopen/ildetect.c | 3 +-- TOOLS/vf_dlopen/rectangle.c | 3 +-- TOOLS/vf_dlopen/telecine.c | 3 +-- TOOLS/vf_dlopen/tile.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/vf_dlopen/framestep.c b/TOOLS/vf_dlopen/framestep.c index 4e25f295ca..11c5afe349 100644 --- a/TOOLS/vf_dlopen/framestep.c +++ b/TOOLS/vf_dlopen/framestep.c @@ -90,8 +90,7 @@ int vf_dlopen_getcontext(struct vf_dlopen_context *ctx, int argc, const char **a if (argc != 1 && argc != 2) return -1; - framestep_data_t *framestep = malloc(sizeof(framestep_data_t)); - memset(framestep, 0, sizeof(*framestep)); + framestep_data_t *framestep = calloc(1,sizeof(framestep_data_t)); framestep->step = atoi(argv[0]); framestep->pos = (argc >= 2) ? atoi(argv[1]) : 0; diff --git a/TOOLS/vf_dlopen/ildetect.c b/TOOLS/vf_dlopen/ildetect.c index ef4e45f013..d2f3d5bde5 100644 --- a/TOOLS/vf_dlopen/ildetect.c +++ b/TOOLS/vf_dlopen/ildetect.c @@ -267,8 +267,7 @@ int vf_dlopen_getcontext(struct vf_dlopen_context *ctx, int argc, const char **a (void) argc; (void) argv; - ildetect_data_t *il = malloc(sizeof(ildetect_data_t)); - memset(il, 0, sizeof(*il)); + ildetect_data_t *il = calloc(1,sizeof(ildetect_data_t)); #define A(i,d) ((argc>(i) && *argv[i]) ? atof(argv[i]) : (d)) il->method = A(0, 0); diff --git a/TOOLS/vf_dlopen/rectangle.c b/TOOLS/vf_dlopen/rectangle.c index 0aaa360598..f0827c974b 100644 --- a/TOOLS/vf_dlopen/rectangle.c +++ b/TOOLS/vf_dlopen/rectangle.c @@ -348,8 +348,7 @@ int vf_dlopen_getcontext(struct vf_dlopen_context *ctx, int argc, const char **a { "yuv420p", "yuv420p" }, { NULL, NULL } }; - privdata *priv = malloc(sizeof(privdata)); - memset(priv, 0, sizeof(*priv)); + privdata *priv = calloc(1,sizeof(privdata)); priv->step = 8; if(argc >= 1) priv->w = atoi(argv[0]); diff --git a/TOOLS/vf_dlopen/telecine.c b/TOOLS/vf_dlopen/telecine.c index b2ad303119..6c5eb4adc0 100644 --- a/TOOLS/vf_dlopen/telecine.c +++ b/TOOLS/vf_dlopen/telecine.c @@ -237,8 +237,7 @@ int vf_dlopen_getcontext(struct vf_dlopen_context *ctx, int argc, const char **a if (!a0[0] || a0[1] || !a1[0] || argc > 2) return -1; - tc_data_t *tc = malloc(sizeof(tc_data_t)); - memset(tc, 0, sizeof(*tc)); + tc_data_t *tc = calloc(1,sizeof(tc_data_t)); if (a0[0] == 't') tc->firstfield = 0; diff --git a/TOOLS/vf_dlopen/tile.c b/TOOLS/vf_dlopen/tile.c index 57355bbc4c..bf5aeea26f 100644 --- a/TOOLS/vf_dlopen/tile.c +++ b/TOOLS/vf_dlopen/tile.c @@ -150,8 +150,7 @@ int vf_dlopen_getcontext(struct vf_dlopen_context *ctx, int argc, const char **a if (argc != 2) return -1; - tile_data_t *tile = malloc(sizeof(tile_data_t)); - memset(tile, 0, sizeof(*tile)); + tile_data_t *tile = calloc(1,sizeof(tile_data_t)); tile->cols = atoi(argv[0]); tile->rows = atoi(argv[1]); -- cgit v1.2.3