From 16042720fec3fb24f5a5da6cd33d5d1ad4e88a11 Mon Sep 17 00:00:00 2001 From: Jason Summers Date: Wed, 9 Jun 2021 10:15:22 -0400 Subject: [PATCH] Cleanup - Made the codec API more consistent --- modules/dms.c | 2 +- src/deark-fmtutil.h | 2 +- src/fmtutil-cmpr.c | 4 ++-- src/fmtutil-lzah.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/dms.c b/modules/dms.c index 812261c4..cf495c64 100644 --- a/modules/dms.c +++ b/modules/dms.c @@ -737,7 +737,7 @@ static void medium_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n) mctx->nbytes_written++; } -static void mediumlz77_codec_command(struct de_dfilter_ctx *dfctx, int cmd) +static void mediumlz77_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags) { struct medium_ctx *mctx = (struct medium_ctx*)dfctx->codec_private; diff --git a/src/deark-fmtutil.h b/src/deark-fmtutil.h index eca39751..ba60ddff 100644 --- a/src/deark-fmtutil.h +++ b/src/deark-fmtutil.h @@ -134,7 +134,7 @@ struct de_dfilter_ctx; typedef void (*dfilter_codec_type)(struct de_dfilter_ctx *dfctx, void *codec_private_params); typedef void (*dfilter_codec_addbuf_type)(struct de_dfilter_ctx *dfctx, const u8 *buf, i64 buf_len); -typedef void (*dfilter_codec_command_type)(struct de_dfilter_ctx *dfctx, int cmd); +typedef void (*dfilter_codec_command_type)(struct de_dfilter_ctx *dfctx, int cmd, UI flags); typedef void (*dfilter_codec_finish_type)(struct de_dfilter_ctx *dfctx); typedef void (*dfilter_codec_destroy_type)(struct de_dfilter_ctx *dfctx); diff --git a/src/fmtutil-cmpr.c b/src/fmtutil-cmpr.c index 92596ccf..32c59949 100644 --- a/src/fmtutil-cmpr.c +++ b/src/fmtutil-cmpr.c @@ -133,7 +133,7 @@ void de_dfilter_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags) // Codec-specific things: if(dfctx->codec_command_fn) { - dfctx->codec_command_fn(dfctx, cmd); + dfctx->codec_command_fn(dfctx, cmd, flags); } } @@ -304,7 +304,7 @@ static void my_packbits_codec_addbuf(struct de_dfilter_ctx *dfctx, } } -static void my_packbits_codec_command(struct de_dfilter_ctx *dfctx, int cmd) +static void my_packbits_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags) { struct packbitsctx *rctx = (struct packbitsctx*)dfctx->codec_private; diff --git a/src/fmtutil-lzah.c b/src/fmtutil-lzah.c index 2d83c583..de543542 100644 --- a/src/fmtutil-lzah.c +++ b/src/fmtutil-lzah.c @@ -53,7 +53,7 @@ static void my_lh1_codec_finish(struct de_dfilter_ctx *dfctx) } } -static void my_lh1_codec_command(struct de_dfilter_ctx *dfctx, int cmd) +static void my_lh1_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags) { struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)dfctx->codec_private; -- 2.11.4.GIT