compat/fnmatch: update old-style definition to ANSI

We try to avoid touching borrowed code, but we encourage people to write without old-style definition and compile with -Werror these days, and on platforms that need to use NO_FNMATCH, these three functions make the compilation fail. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Dec 19, 2012 at 08:54 UTC 38104ca6b98180efc6bdb6a56c1fcc3910e29d68
1 file changed +12 -12
compat/fnmatch/fnmatch.c
+12 -12
@@ -135,9 +135,9 @@ extern int errno;
135
136 # if !defined HAVE___STRCHRNUL && !defined _LIBC
137 static char *
138 -__strchrnul (s, c)
139 - const char *s;
140 - int c;
138 +__strchrnul (const char *s, int c)
139 +
140 +
141 {
142 char *result = strchr (s, c);
143 if (result == NULL)
@@ -159,11 +159,11 @@ static int internal_fnmatch __P ((const char *pattern, const char *string,
159 internal_function;
160 static int
161 internal_function
162 -internal_fnmatch (pattern, string, no_leading_period, flags)
163 - const char *pattern;
164 - const char *string;
165 - int no_leading_period;
166 - int flags;
162 +internal_fnmatch (const char *pattern, const char *string, int no_leading_period, int flags)
163 +
164 +
165 +
166 +
167 {
168 register const char *p = pattern, *n = string;
169 register unsigned char c;
@@ -481,10 +481,10 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
481
482
483 int
484 -fnmatch (pattern, string, flags)
485 - const char *pattern;
486 - const char *string;
487 - int flags;
484 +fnmatch (const char *pattern, const char *string, int flags)
485 +
486 +
487 +
488 {
489 return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
490 }