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 ---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/driver') 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; -- cgit v1.2.3