git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH] compat/fnmatch: update old-style definition to ANSI

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2012, 17:08 UTC
Message-ID
<7vvcby9dgi.fsf@alter.siamese.dyndns.org>

We usually try to avoid touching borrowed code, but we encourage people to code without old-style definition these days and compile with -Werror, 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>
---
 compat/fnmatch/fnmatch.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 0ff1d27..b8b7dc2 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -135,9 +135,9 @@ extern int errno;
 
 # if !defined HAVE___STRCHRNUL && !defined _LIBC
 static char *
-__strchrnul (s, c)
-     const char *s;
-     int c;
+__strchrnul (const char *s, int c)
+
+
 {
   char *result = strchr (s, c);
   if (result == NULL)
@@ -159,11 +159,11 @@ static int internal_fnmatch __P ((const char *pattern, const char *string,
      internal_function;
 static int
 internal_function
-internal_fnmatch (pattern, string, no_leading_period, flags)
-     const char *pattern;
-     const char *string;
-     int no_leading_period;
-     int flags;
+internal_fnmatch (const char *pattern, const char *string, int no_leading_period, int flags)
+
+
+
+
 {
   register const char *p = pattern, *n = string;
   register unsigned char c;
@@ -481,10 +481,10 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
 
 
 int
-fnmatch (pattern, string, flags)
-     const char *pattern;
-     const char *string;
-     int flags;
+fnmatch (const char *pattern, const char *string, int flags)
+
+
+
 {
   return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
 }
-- 
1.8.1.rc2.196.g654d69e
Message 1 of 1 in “compat/fnmatch: update old-style definition to ANSI”
  1. compat/fnmatch: update old-style definition to ANSIJunio C Hamano, Dec 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.