diff options
author | midipix <writeonce@midipix.org> | 2018-08-09 05:56:15 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-08-09 05:57:12 -0400 |
commit | e1a7721fe04ace25388a3438a0d943bb183245bc (patch) | |
tree | f4993798163a1e0396af553b42dcecddbe9aebc5 | |
parent | db3db23bbfa09ad13c5e1741c9f961b1ae98383a (diff) | |
download | perk-e1a7721fe04ace25388a3438a0d943bb183245bc.tar.bz2 perk-e1a7721fe04ace25388a3438a0d943bb183245bc.tar.xz |
front-end utility: pe_main(): remove the redundant argc parameter.
-rw-r--r-- | include/perk/perk.h | 2 | ||||
-rw-r--r-- | project/overrides.mk | 1 | ||||
-rw-r--r-- | src/driver/pe_amain.c | 4 | ||||
-rw-r--r-- | src/perk.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h index 2860c53..bc6ea8f 100644 --- a/include/perk/perk.h +++ b/include/perk/perk.h @@ -189,7 +189,7 @@ perk_api int pe_get_driver_fdctx (const struct pe_driver_ctx *, struct pe perk_api int pe_set_driver_fdctx (struct pe_driver_ctx *, const struct pe_fd_ctx *); /* utility api */ -perk_api int pe_main (int, char **, char **, const struct pe_fd_ctx *); +perk_api int pe_main (char **, char **, const struct pe_fd_ctx *); perk_api int pe_output_image_category (const struct pe_driver_ctx *, const struct pe_image_meta *); perk_api int pe_output_image_sections (const struct pe_driver_ctx *, const struct pe_image_meta *); diff --git a/project/overrides.mk b/project/overrides.mk index e69de29..4ac3b36 100644 --- a/project/overrides.mk +++ b/project/overrides.mk @@ -0,0 +1 @@ +src/$(PACKAGE).o: CFLAGS_CONFIG += -Wno-unused-parameter diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index 585d50a..50d18ac 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -83,7 +83,7 @@ static int pe_exit(struct pe_driver_ctx * dctx, int ret) return ret; } -int pe_main(int argc, char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) +int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) { int ret; int fdout; @@ -97,7 +97,7 @@ int pe_main(int argc, char ** argv, char ** envp, const struct pe_fd_ctx * fdctx if ((ret = pe_get_driver_ctx(argv,envp,flags,fdctx,&dctx))) return (ret == PERK_USAGE) - ? !--argc + ? !argv || !argv[0] || !argv[1] : PERK_ERROR; if (dctx->cctx->drvflags & PERK_DRIVER_VERSION) @@ -8,5 +8,5 @@ int main(int argc, char ** argv, char ** envp) { - return pe_main(argc,argv,envp,0); + return pe_main(argv,envp,0); } |