From bb542332dcdccf9e936e1ad1eba437e408c162bf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 20 Feb 2017 06:48:32 +0100 Subject: [PATCH] scaler_ctx_gen_reset - get rid of memsets --- libretro-common/gfx/scaler/scaler.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/libretro-common/gfx/scaler/scaler.c b/libretro-common/gfx/scaler/scaler.c index 7e8921abdc..0d9d3b101f 100644 --- a/libretro-common/gfx/scaler/scaler.c +++ b/libretro-common/gfx/scaler/scaler.c @@ -307,11 +307,26 @@ void scaler_ctx_gen_reset(struct scaler_ctx *ctx) scaler_free(ctx->input.frame); scaler_free(ctx->output.frame); - memset(&ctx->horiz, 0, sizeof(ctx->horiz)); - memset(&ctx->vert, 0, sizeof(ctx->vert)); - memset(&ctx->scaled, 0, sizeof(ctx->scaled)); - memset(&ctx->input, 0, sizeof(ctx->input)); - memset(&ctx->output, 0, sizeof(ctx->output)); + ctx->horiz.filter = NULL; + ctx->horiz.filter_len = 0; + ctx->horiz.filter_stride = 0; + ctx->horiz.filter_pos = NULL; + + ctx->vert.filter = NULL; + ctx->vert.filter_len = 0; + ctx->vert.filter_stride = 0; + ctx->vert.filter_pos = NULL; + + ctx->scaled.frame = NULL; + ctx->scaled.width = 0; + ctx->scaled.height = 0; + ctx->scaled.stride = 0; + + ctx->input.frame = NULL; + ctx->input.stride = 0; + + ctx->output.frame = NULL; + ctx->output.stride = 0; } /**