From 3be86d2cc36db6b3fea94a35c1c61fca8c087aff Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 25 Oct 2016 23:44:29 -0400 Subject: struct sfrt_unit_ctx: removed cctx (pass pointer to driver context instead). --- src/driver/sfrt_amain.c | 8 +++++--- src/driver/sfrt_unit_ctx.c | 4 ---- src/internal/sofort_driver_impl.h | 1 - 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/driver/sfrt_amain.c b/src/driver/sfrt_amain.c index 3766b67..ebed412 100644 --- a/src/driver/sfrt_amain.c +++ b/src/driver/sfrt_amain.c @@ -39,9 +39,11 @@ static ssize_t sfrt_version(struct sfrt_driver_ctx * dctx) verclr[4],verinfo->commit,verclr[5]); } -static void sfrt_perform_unit_actions(struct sfrt_unit_ctx * uctx) +static void sfrt_perform_unit_actions( + const struct sfrt_driver_ctx * dctx, + struct sfrt_unit_ctx * uctx) { - uint64_t flags = uctx->cctx->actflags; /* dummy */ + uint64_t flags = dctx->cctx->actflags; /* dummy */ /* dummy */ if (flags & SFRT_OUTPUT_NAME) { /* dummy */ uctx->status = sfrt_output_name(uctx,stdout); /* dummy */ @@ -81,7 +83,7 @@ int sfrt_main(int argc, char ** argv, char ** envp) /* dummy */ for (unit=dctx->units; *unit; unit++) { if (!(sfrt_get_unit_ctx(dctx,*unit,&uctx))) { - sfrt_perform_unit_actions(uctx); + sfrt_perform_unit_actions(dctx,uctx); ret += uctx->nerrors; sfrt_free_unit_ctx(uctx); } diff --git a/src/driver/sfrt_unit_ctx.c b/src/driver/sfrt_unit_ctx.c index 0052cce..630fdba 100644 --- a/src/driver/sfrt_unit_ctx.c +++ b/src/driver/sfrt_unit_ctx.c @@ -39,14 +39,10 @@ int sfrt_get_unit_ctx( return sfrt_free_unit_ctx_impl(ctx, SFRT_NESTED_ERROR(dctx)); - memcpy(&ctx->cctx,dctx->cctx, - sizeof(ctx->cctx)); - ctx->path = path; ctx->uctx.path = &ctx->path; ctx->uctx.map = &ctx->map; - ctx->uctx.cctx = &ctx->cctx; *pctx = &ctx->uctx; return 0; diff --git a/src/internal/sofort_driver_impl.h b/src/internal/sofort_driver_impl.h index 1322aac..d6d2e44 100644 --- a/src/internal/sofort_driver_impl.h +++ b/src/internal/sofort_driver_impl.h @@ -31,7 +31,6 @@ struct sfrt_driver_ctx_impl { struct sfrt_unit_ctx_impl { const char * path; struct sfrt_input map; - struct sfrt_common_ctx cctx; struct sfrt_unit_ctx uctx; }; -- cgit v1.2.3