From: Tobias Klauser <tklauser@distanz.ch>
To: Junio C Hamano <gitster@pobox.com>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>, git@vger.kernel.org
Subject: Re: [PATCH 2/3] stripspace: Implement --count-lines option
Date: Sat, 17 Oct 2015 12:44:25 +0200 [thread overview]
Message-ID: <20151017104425.GF2468@distanz.ch> (raw)
In-Reply-To: <xmqq8u72g1hm.fsf@gitster.mtv.corp.google.com>
On 2015-10-16 at 19:35:49 +0200, Junio C Hamano <gitster@pobox.com> wrote:
> Tobias Klauser <tklauser@distanz.ch> writes:
>
> >> So this is your output code, which gives only the number of lines
> >> without the cleaned up result.
> >
> > This should better be a simple printf("%zu\n", lines) I guess?
>
> I think we actively avoid using %z conversion that is only C99.
>
> If you really want to, you could count in size_t and use %lu with
> appropriate casting, which I think is what we do in the rest of the
> codebase.
>
> For this one, I think it is sufficient to just count in int and
> print as int with %d, though.
Ok, will use an int to count and printf("%d\n").
next prev parent reply other threads:[~2015-10-17 10:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 12:18 [PATCH 0/3] stripspace: Implement and use --count-lines option Tobias Klauser
2015-10-15 12:18 ` [PATCH 1/3] strbuf: make stripspace() part of strbuf Tobias Klauser
2015-10-15 16:42 ` Matthieu Moy
2015-10-16 7:14 ` Tobias Klauser
2015-10-15 16:43 ` Matthieu Moy
2015-10-15 17:36 ` Junio C Hamano
2015-10-16 7:09 ` Tobias Klauser
2015-10-15 12:18 ` [PATCH 2/3] stripspace: Implement --count-lines option Tobias Klauser
2015-10-15 16:52 ` Matthieu Moy
2015-10-16 7:21 ` Tobias Klauser
2015-10-16 8:40 ` Tobias Klauser
2015-10-16 8:59 ` Matthieu Moy
2015-10-15 17:58 ` Junio C Hamano
2015-10-16 7:51 ` Tobias Klauser
2015-10-16 17:35 ` Junio C Hamano
2015-10-17 10:44 ` Tobias Klauser [this message]
2015-10-15 19:21 ` Matthieu Moy
2015-10-16 7:54 ` Tobias Klauser
2015-10-15 12:18 ` [PATCH 3/3] git rebase -i: Use newly added --count-lines option for stripspace Tobias Klauser
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=20151017104425.GF2468@distanz.ch \
--to=tklauser@distanz.ch \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).