git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] prio-queue: use size_t rather than int for size
Date: Fri, 20 Dec 2024 07:27:18 -0800	[thread overview]
Message-ID: <xmqqh66yfk89.fsf@gitster.g> (raw)
In-Reply-To: <20241220085337.GA133148@coredump.intra.peff.net> (Jeff King's message of "Fri, 20 Dec 2024 03:53:37 -0500")

Jeff King <peff@peff.net> writes:

> On Fri, Dec 20, 2024 at 03:49:49AM -0500, Jeff King wrote:
>
>> -static inline int compare(struct prio_queue *queue, int i, int j)
>> +static inline int compare(struct prio_queue *queue, size_t i, size_t j)
>>  {
>>  	int cmp = queue->compare(queue->array[i].data, queue->array[j].data,
>>  				 queue->cb_data);
>>  	if (!cmp)
>> -		cmp = queue->array[i].ctr - queue->array[j].ctr;
>> +		cmp = (queue->array[i].ctr > queue->array[j].ctr) -
>> +	              (queue->array[i].ctr < queue->array[j].ctr);
>>  	return cmp;
>>  }
>
> Sorry, just realized that "diff --check" (and apply) complains about the
> indentation here. It's a TAB followed by 14 spaces, instead of two TABs
> followed by 6 spaces. I guess caused by me lining things up manually.

"git am --whitespace=fix" with or without "-3" corrects such
glitches just fine, and "git am --whitespace=error" correctly stops
me from applying such a patch.

What is worrysome is "git am -3 --whitespace=warn" does not seem to
catch it (without "-3" it works just fine).  I do not know offhand
if this is a recent regression or not.



  reply	other threads:[~2024-12-20 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20  8:49 [PATCH] prio-queue: use size_t rather than int for size Jeff King
2024-12-20  8:53 ` Jeff King
2024-12-20 15:27   ` Junio C Hamano [this message]
2024-12-20 16:01     ` Jeff King
2024-12-27 10:15 ` Patrick Steinhardt
2024-12-27 14:34   ` Jeff King

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=xmqqh66yfk89.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).