From 875eaea988a6748ff515360359c63b78e6f0e0b9 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Sat, 15 Jun 2013 06:29:48 +0100 Subject: [PATCH] Followup for "Win32: move main macro to a function" for const correctness. This handles const warnings that break the build raised by http-fetch and remote-curl main functions that have different const arguments. Signed-off-by: Pat Thoyts --- compat/mingw.h | 2 +- http-fetch.c | 3 ++- remote-curl.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compat/mingw.h b/compat/mingw.h index aef8709c27..26b5ae5637 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -351,7 +351,7 @@ extern CRITICAL_SECTION pinfo_cs; void mingw_startup(); #define main(c,v) dummy_decl_mingw_main(); \ static int mingw_main(c,v); \ -int main(int argc, char **argv) \ +int main(c,v) \ { \ mingw_startup(); \ return mingw_main(__argc, __argv); \ diff --git a/http-fetch.c b/http-fetch.c index ba3ea10670..51b26d7af8 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -6,11 +6,12 @@ static const char http_fetch_usage[] = "git http-fetch " "[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url"; -int main(int argc, const char **argv) +int main(int argc, char **av) { struct walker *walker; int commits_on_stdin = 0; int commits; + const char **argv = (const char **)av; const char **write_ref = NULL; char **commit_id; char *url = NULL; diff --git a/remote-curl.c b/remote-curl.c index 5b3ce9eed2..f1119fbd0c 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -866,9 +866,10 @@ static void parse_push(struct strbuf *buf) free(specs); } -int main(int argc, const char **argv) +int main(int argc, char **av) { struct strbuf buf = STRBUF_INIT; + const char **argv = (const char **)av; int nongit; git_extract_argv0_path(argv[0]);