From a92be9b856bd11b081041c43c25d442028fe9a63 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 6 Jun 2011 14:13:02 +0200 Subject: Replace memset(0) by zero initializations. Also remove one pointless zero initialization in rangecoder.c. --- libavcodec/alsdec.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libavcodec/alsdec.c') diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 1b916e4ff2..35952ae21f 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1026,9 +1026,7 @@ static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame, unsigned int *js_blocks) { unsigned int b; - ALSBlockData bd; - - memset(&bd, 0, sizeof(ALSBlockData)); + ALSBlockData bd = { 0 }; bd.ra_block = ra_frame; bd.const_block = ctx->const_block; @@ -1069,9 +1067,7 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame, ALSSpecificConfig *sconf = &ctx->sconf; unsigned int offset = 0; unsigned int b; - ALSBlockData bd[2]; - - memset(bd, 0, 2 * sizeof(ALSBlockData)); + ALSBlockData bd[2] = { { 0 } }; bd[0].ra_block = ra_frame; bd[0].const_block = ctx->const_block; @@ -1337,7 +1333,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) sizeof(*ctx->raw_samples[c]) * sconf->max_order); } } else { // multi-channel coding - ALSBlockData bd; + ALSBlockData bd = { 0 }; int b; int *reverted_channels = ctx->reverted_channels; unsigned int offset = 0; @@ -1348,7 +1344,6 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) return -1; } - memset(&bd, 0, sizeof(ALSBlockData)); memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels); bd.ra_block = ra_frame; -- cgit v1.2.3