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

[PATCH] convert.c: fix some sparse warnings

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Apr 3, 2016, 18:43 UTC
Message-ID
<57016457.30405@ramsayjones.plus.com>
Sparse complains thus:
        SP convert.c
    convert.c:180:24: warning: Using plain integer as NULL pointer
    convert.c:241:28: warning: dubious: !x & y
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Torsten,

When you re-roll your 'tb/safe-crlf-output-fix' branch, could you please squash this into your patch (corresponding to commit 9c7b132f, "convert.c: more safer crlf handling with text attribute", 01-04-2016).

>From an earlier email, I see that you are aware that t6038 is failing, so
I won't look into that.
Thanks!

ATB, Ramsay Jones

 convert.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/convert.c b/convert.c
index 1fddbe8..1fa7986 100644
--- a/convert.c
+++ b/convert.c
@@ -177,7 +177,7 @@ const char *get_wt_convert_stats_ascii(const char *path)
 	memset(&stats, 0, sizeof(stats));
 	fd = open(path, O_RDONLY);
 	if (fd < 0)
-		return 0;
+		return NULL;
 	for (;;) {
 		char buf[1024];
 		ssize_t readlen = read(fd, buf, sizeof(buf));
@@ -238,7 +238,7 @@ static int would_convert_lf_at_checkout(unsigned convert_stats,
 		return 0;
 
 	/* No "naked" LF? Nothing to convert, regardless. */
-	if (!convert_stats & CONVERT_STAT_BITS_TXT_LF)
+	if (!(convert_stats & CONVERT_STAT_BITS_TXT_LF))
 		return 0;
 
 	if (crlf_action == CRLF_AUTO ||
-- 
2.8.0
Message 1 of 1 in “convert.c: fix some sparse warnings”
  1. convert.c: fix some sparse warningsRamsay Jones, Apr 3, 2016

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.