Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 6949537

Browse files
committed
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 <patthoyts@users.sourceforge.net>
1 parent 0115ef8 commit 6949537

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

compat/mingw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ extern CRITICAL_SECTION pinfo_cs;
374374
void mingw_startup();
375375
#define main(c,v) dummy_decl_mingw_main(); \
376376
static int mingw_main(c,v); \
377-
int main(int argc, char **argv) \
377+
int main(c,v) \
378378
{ \
379379
mingw_startup(); \
380380
return mingw_main(__argc, __argv); \

http-fetch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
static const char http_fetch_usage[] = "git http-fetch "
77
"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url";
88

9-
int main(int argc, const char **argv)
9+
int main(int argc, char **av)
1010
{
1111
struct walker *walker;
1212
int commits_on_stdin = 0;
1313
int commits;
14+
const char **argv = (const char **)av;
1415
const char **write_ref = NULL;
1516
char **commit_id;
1617
char *url = NULL;

remote-curl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,9 +905,10 @@ static void parse_push(struct strbuf *buf)
905905
free(specs);
906906
}
907907

908-
int main(int argc, const char **argv)
908+
int main(int argc, char **av)
909909
{
910910
struct strbuf buf = STRBUF_INIT;
911+
const char **argv = (const char **)av;
911912
int nongit;
912913

913914
git_extract_argv0_path(argv[0]);

0 commit comments

Comments
 (0)