summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 22:02:27 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:53 -0500
commiteed8012ce892877caa16f1130a5e8037e672f043 (patch)
treebb38d2793b56295b373c8937cca6e5041e646218 /src
parentf64a5b0864c52fcf372c12a92cf9ba5feaa13e77 (diff)
downloadperk-eed8012ce892877caa16f1130a5e8037e672f043.tar.bz2
perk-eed8012ce892877caa16f1130a5e8037e672f043.tar.xz
struct pe_unit_ctx: removed cctx (pass pointer to the driver context instead).
Diffstat (limited to 'src')
-rw-r--r--src/driver/pe_amain.c10
-rw-r--r--src/driver/pe_unit_ctx.c4
-rw-r--r--src/internal/perk_driver_impl.h1
3 files changed, 5 insertions, 10 deletions
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;
};