diff options
author | midipix <writeonce@midipix.org> | 2016-10-24 22:02:27 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-10 23:35:53 -0500 |
commit | eed8012ce892877caa16f1130a5e8037e672f043 (patch) | |
tree | bb38d2793b56295b373c8937cca6e5041e646218 | |
parent | f64a5b0864c52fcf372c12a92cf9ba5feaa13e77 (diff) | |
download | perk-eed8012ce892877caa16f1130a5e8037e672f043.tar.bz2 perk-eed8012ce892877caa16f1130a5e8037e672f043.tar.xz |
struct pe_unit_ctx: removed cctx (pass pointer to the driver context instead).
-rw-r--r-- | include/perk/perk.h | 1 | ||||
-rw-r--r-- | src/driver/pe_amain.c | 10 | ||||
-rw-r--r-- | src/driver/pe_unit_ctx.c | 4 | ||||
-rw-r--r-- | src/internal/perk_driver_impl.h | 1 |
4 files changed, 5 insertions, 11 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h index d30971e..41e25f0 100644 --- a/include/perk/perk.h +++ b/include/perk/perk.h @@ -181,7 +181,6 @@ struct pe_unit_ctx { const char * const * path; const struct pe_raw_image * map; const struct pe_image_meta * meta; - const struct pe_common_ctx * cctx; void * any; int status; int nerrors; 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; }; |