{"thread":{"id":"32406","subject":"[RFC/PATCH] compat/fnmatch: update old-style definition to ANSI","startedAt":"2012-12-19T17:08:45Z","lastAt":"2012-12-19T17:08:45Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"205200","messageId":"7vvcby9dgi.fsf@alter.siamese.dyndns.org","threadId":"32406","inReplyTo":null,"subject":"[RFC/PATCH] compat/fnmatch: update old-style definition to ANSI","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-19T17:08:45Z","receivedAt":"2012-12-19T17:08:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"We usually try to avoid touching borrowed code, but we encourage\npeople to code without old-style definition these days and compile\nwith -Werror, and on platforms that need to use NO_FNMATCH, these\nthree functions make the compilation fail.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n compat/fnmatch/fnmatch.c | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c\nindex 0ff1d27..b8b7dc2 100644\n--- a/compat/fnmatch/fnmatch.c\n+++ b/compat/fnmatch/fnmatch.c\n@@ -135,9 +135,9 @@ extern int errno;\n \n # if !defined HAVE___STRCHRNUL && !defined _LIBC\n static char *\n-__strchrnul (s, c)\n-     const char *s;\n-     int c;\n+__strchrnul (const char *s, int c)\n+\n+\n {\n   char *result = strchr (s, c);\n   if (result == NULL)\n@@ -159,11 +159,11 @@ static int internal_fnmatch __P ((const char *pattern, const char *string,\n      internal_function;\n static int\n internal_function\n-internal_fnmatch (pattern, string, no_leading_period, flags)\n-     const char *pattern;\n-     const char *string;\n-     int no_leading_period;\n-     int flags;\n+internal_fnmatch (const char *pattern, const char *string, int no_leading_period, int flags)\n+\n+\n+\n+\n {\n   register const char *p = pattern, *n = string;\n   register unsigned char c;\n@@ -481,10 +481,10 @@ internal_fnmatch (pattern, string, no_leading_period, flags)\n \n \n int\n-fnmatch (pattern, string, flags)\n-     const char *pattern;\n-     const char *string;\n-     int flags;\n+fnmatch (const char *pattern, const char *string, int flags)\n+\n+\n+\n {\n   return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);\n }\n-- \n1.8.1.rc2.196.g654d69e\n"}]}