Skip to contentSkip to conversation

convert.c: Fix return type of git_path_check_eol()

PATCH In review Ramsay Jones 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 convert.c: Fix return type of git_path_check_eol()

The git_path_check_eol() function converts a string value to the corresponding 'enum eol' value. However, the function is currently declared to return an 'enum crlf_action', which causes sparse to complain thus:

SP convert.c
convert.c:736:50: warning: mixing different enum types
convert.c:736:50: int enum crlf_action versus
convert.c:736:50: int enum eol

In order to suppress the warning, we simply correct the return type in the function declaration.

---
 convert.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
convert.c +1 -1
index 038b0be..86e9c29 100644
@@ -658,7 +658,7 @@ static enum crlf_action git_path_check_crlf(const char *path, struct git_attr_ch
 	return CRLF_GUESS;
 }
 
-static enum crlf_action git_path_check_eol(const char *path, struct git_attr_check *check)
+static enum eol git_path_check_eol(const char *path, struct git_attr_check *check)
 {
 	const char *value = check->value;
 
Signature · 1 line
1.7.7
#1 lore raw

Hi Ramsay,

Quoted 6 lines · Ramsay Jones

[...]

convert.c +0 -0
index 038b0be..86e9c29 100644

convert.c static enum crlf_action git_path_check_crlf(const char *path, struct git_attr_ch · line 664

Quoted 8 lines
convert.c +1 -1
@@ -658,7 +658,7 @@ static enum crlf_action git_path_check_crlf(const char *path, struct git_attr_ch
        return CRLF_GUESS;
  }
 
-static enum crlf_action git_path_check_eol(const char *path, struct git_attr_check *check)
+static enum eol git_path_check_eol(const char *path, struct git_attr_check *check)
  {
        const char *value = check->value;
 

Looks good. Thanks.

-- Ram