All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH] convert.c: fix some sparse warnings
Date: Sun, 3 Apr 2016 19:43:35 +0100	[thread overview]
Message-ID: <57016457.30405@ramsayjones.plus.com> (raw)


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

             reply	other threads:[~2016-04-03 18:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-03 18:43 Ramsay Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-24 17:14 [PATCH] convert.c: fix some sparse warnings Ramsay Jones
2016-04-25  4:15 ` Torsten Bögershausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57016457.30405@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.