summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-09 05:25:51 -0400
committermidipix <writeonce@midipix.org>2018-08-09 05:25:51 -0400
commit69302dc003c0e55dc9b5ce67b9bb3f2ad31d5284 (patch)
tree483f08f7bd0dc47ac0f75fb2e4fe46396593abdd
parenta1d11435c880dcf7febbc590e04696a90923bcc3 (diff)
downloadsofort-69302dc003c0e55dc9b5ce67b9bb3f2ad31d5284.tar.bz2
sofort-69302dc003c0e55dc9b5ce67b9bb3f2ad31d5284.tar.xz
front-end utility: sfrt_main(): remove the redundant argc parameter.
-rw-r--r--include/sofort/sofort.h2
-rw-r--r--project/overrides.mk1
-rw-r--r--src/driver/sfrt_amain.c4
-rw-r--r--src/sofort.c2
4 files changed, 5 insertions, 4 deletions
diff --git a/include/sofort/sofort.h b/include/sofort/sofort.h
index e516d90..5495b94 100644
--- a/include/sofort/sofort.h
+++ b/include/sofort/sofort.h
@@ -129,7 +129,7 @@ sfrt_api int sfrt_get_driver_fdctx (const struct sfrt_driver_ctx *, struct
sfrt_api int sfrt_set_driver_fdctx (struct sfrt_driver_ctx *, const struct sfrt_fd_ctx *);
/* utility api */
-sfrt_api int sfrt_main (int, char **, char **, const struct sfrt_fd_ctx *);
+sfrt_api int sfrt_main (char **, char **, const struct sfrt_fd_ctx *);
sfrt_api int sfrt_output_dummy (const struct sfrt_driver_ctx *); /* dummy */
sfrt_api int sfrt_output_name (const struct sfrt_driver_ctx *, const struct sfrt_unit_ctx *); /* dummy */
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/sfrt_amain.c b/src/driver/sfrt_amain.c
index 60ad615..075d9f8 100644
--- a/src/driver/sfrt_amain.c
+++ b/src/driver/sfrt_amain.c
@@ -61,7 +61,7 @@ static int sfrt_exit(struct sfrt_driver_ctx * dctx, int ret)
return ret;
}
-int sfrt_main(int argc, char ** argv, char ** envp, const struct sfrt_fd_ctx * fdctx)
+int sfrt_main(char ** argv, char ** envp, const struct sfrt_fd_ctx * fdctx)
{
int ret;
int fdout;
@@ -75,7 +75,7 @@ int sfrt_main(int argc, char ** argv, char ** envp, const struct sfrt_fd_ctx * f
if ((ret = sfrt_get_driver_ctx(argv,envp,flags,fdctx,&dctx)))
return (ret == SFRT_USAGE)
- ? !--argc
+ ? !argv || !argv[0] || !argv[1]
: SFRT_ERROR;
if (dctx->cctx->drvflags & SFRT_DRIVER_VERSION)
diff --git a/src/sofort.c b/src/sofort.c
index d52059e..0c1279e 100644
--- a/src/sofort.c
+++ b/src/sofort.c
@@ -2,5 +2,5 @@
int main(int argc, char ** argv, char ** envp)
{
- return sfrt_main(argc,argv,envp,0);
+ return sfrt_main(argv,envp,0);
}