git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnav Bhate <bhatearnav@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [GSoC PATCH] pathspec: fix sign comparison warnings
Date: Sun, 16 Mar 2025 15:44:54 +0530	[thread overview]
Message-ID: <a720058a-f8cd-422c-a8c3-af7536bfc880@gmail.com> (raw)
In-Reply-To: <xmqqcyelq714.fsf@gitster.g>

Junio C Hamano <gitster@pobox.com> writes:
> Karthik Nayak <karthik.188@gmail.com> writes:
> 
>> Also a bigger question is, shouldn't the type of `pathspec.nr` and
>> 'istate.cache_nr' be the actual change required? Shouldn't they be set
>> to 'size_t'?
> 
> Please do not blindly advocate the idea that size_t is always the
> right type for any countables.  It is not.  
> 
> Platform natural way to count things is either "unsigned int", if
> you are only counting, or "int", if you need to be able to signal an
> unusual state other than "here is now many we have in the set", like
> how index related functions uses (-pos-1) to signal a location in
> the same range with different meanings.

I did notice that negative states were sometimes used for such things,
which why I said I didn't want to do the change to unsigned, it would
be too complicated to change such things, and I do not think any
alternative would be better.

-- 
Regards,
Arnav Bhate
(He/Him)


  parent reply	other threads:[~2025-03-16 10:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 20:20 [GSoC PATCH] pathspec: fix sign comparison warnings Arnav Bhate
2025-03-13 12:52 ` Karthik Nayak
2025-03-13 14:20   ` Arnav Bhate
2025-03-13 14:44     ` Karthik Nayak
2025-03-13 15:33   ` Junio C Hamano
2025-03-13 15:50     ` Karthik Nayak
2025-03-16 10:14     ` Arnav Bhate [this message]
2025-03-29  6:17 ` [GSoC PATCH v2] " Arnav Bhate
2025-03-29  6:18   ` Arnav Bhate
2025-03-29 18:36   ` Junio C Hamano
2025-03-30 17:45     ` [GSoC PATCH v3] " Arnav Bhate

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=a720058a-f8cd-422c-a8c3-af7536bfc880@gmail.com \
    --to=bhatearnav@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.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).