From eed8012ce892877caa16f1130a5e8037e672f043 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 24 Oct 2016 22:02:27 -0400 Subject: struct pe_unit_ctx: removed cctx (pass pointer to the driver context instead). --- src/driver/pe_amain.c | 10 +++++----- src/driver/pe_unit_ctx.c | 4 ---- src/internal/perk_driver_impl.h | 1 - 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index e90cede..9ac0a9e 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -46,13 +46,13 @@ static ssize_t pe_version(struct pe_driver_ctx * dctx) verclr[4],verinfo->commit,verclr[5]); } -static ssize_t pe_paragraph_break(struct pe_unit_ctx * uctx, int * fpara) +static ssize_t pe_paragraph_break(const struct pe_driver_ctx * dctx, int * fpara) { if (*fpara) { *fpara = 0; - if (uctx->cctx->ioctx->fdout >= 0) - return write(uctx->cctx->ioctx->fdout,"\n",1); + if (dctx->cctx->ioctx->fdout >= 0) + return write(dctx->cctx->ioctx->fdout,"\n",1); else return fputc('\n',stdout); } else @@ -64,7 +64,7 @@ static void pe_perform_unit_actions( struct pe_unit_ctx * uctx) { int fpara = 0; - uint64_t flags = uctx->cctx->fmtflags; + uint64_t flags = dctx->cctx->fmtflags; if (flags & PERK_OUTPUT_EXPORT_SYMS) { uctx->status = pe_output_export_symbols(dctx,uctx->meta,0); @@ -73,7 +73,7 @@ static void pe_perform_unit_actions( } if ((flags & PERK_OUTPUT_IMPORT_LIBS) || (flags & PERK_OUTPUT_IMPORT_SYMS)) { - pe_paragraph_break(uctx,&fpara); + pe_paragraph_break(dctx,&fpara); uctx->status = pe_output_import_libraries(dctx,uctx->meta,0); uctx->nerrors += !!uctx->status; fpara += (uctx->meta->summary.nimplibs > 0); diff --git a/src/driver/pe_unit_ctx.c b/src/driver/pe_unit_ctx.c index 5330659..06a53f9 100644 --- a/src/driver/pe_unit_ctx.c +++ b/src/driver/pe_unit_ctx.c @@ -51,16 +51,12 @@ int pe_get_unit_ctx( return pe_free_unit_ctx_impl(ctx, PERK_NESTED_ERROR(dctx)); - memcpy(&ctx->cctx,dctx->cctx, - sizeof(ctx->cctx)); - ctx->path = path; ctx->ioctx.prot = prot; ctx->uctx.path = &ctx->path; ctx->uctx.map = &ctx->map; ctx->uctx.meta = ctx->meta; - ctx->uctx.cctx = &ctx->cctx; *pctx = &ctx->uctx; return 0; diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h index bbd5f44..f3af901 100644 --- a/src/internal/perk_driver_impl.h +++ b/src/internal/perk_driver_impl.h @@ -40,7 +40,6 @@ struct pe_unit_ctx_impl { struct pe_raw_image map; struct pe_image_meta * meta; struct pe_io_ctx ioctx; - struct pe_common_ctx cctx; struct pe_unit_ctx uctx; }; -- cgit v1.2.3