Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-16
STALE3734d

[PATCH] convert.c: fix some sparse warnings

From: Ramsay Jones <hidden>
Date: 2016-06-16 02:18:57
Subsystem: the rest · Maintainer: Linus Torvalds

Sparse complains thus:

      SP convert.c
  convert.c:178:24: warning: Using plain integer as NULL pointer
  convert.c:239:28: warning: dubious: !x & y

Signed-off-by: Ramsay Jones <redacted>
---

Hi Torsten,

When you next re-roll your 'tb/convert-eol-autocrlf' branch, could you
please squash this into your patch corresponding to commit cbcc0471
("convert.c: more safer crlf handling with text attribute", 22-04-2016).

[No, you have seen this before! ;-) ]

Thanks!

ATB,
Ramsay Jones

 convert.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/convert.c b/convert.c
index 8d4c42a..3d36c45 100644
--- a/convert.c
+++ b/convert.c
@@ -175,7 +175,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));
@@ -236,7 +236,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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help