[PATCH 1/3] git.c: Kill type mismatch warning.
- From
- Mark Wooding <mdw@distorted.org.uk>
- Date
- Mar 5, 2006, 09:36 UTC
- Message-ID
- <20060305093630.26650.91571.stgit@metalzone.distorted.org.uk>
- In-Reply-To
- <20060305093351.26650.84677.stgit@metalzone.distorted.org.uk>
From: Mark Wooding <mdw@distorted.org.uk>
GCC objects when you pass a `char **' where a `const char **' is wanted. The cast shuts the compiler up, and does the right thing generally.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk> ---
Unfortunately, the warning is fair enough. I can pass a `T' where someone was expecting a `const T', but that would mean that the callee was expecting a `char *const *'. ---
git.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c index a547dbd..69df070 100644 --- a/git.c +++ b/git.c @@ -261,7 +261,7 @@ static int cmd_log(int argc, char **argv int show_parents = 0; const char *commit_prefix = "commit "; - argc = setup_revisions(argc, argv, &rev, "HEAD"); + argc = setup_revisions(argc, (const char **)argv, &rev, "HEAD"); while (1 < argc) { char *arg = argv[1]; if (!strncmp(arg, "--pretty", 8)) {