public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Moumita <dhar61595@gmail.com>
To: git@vger.kernel.org
Cc: Moumita <dhar61595@gmail.com>,
	Abhishek Kumar <abhishekkumar8222@gmail.com>,
	Taylor Blau <me@ttaylorr.com>, Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee <stolee@gmail.com>
Subject: [PATCH 1/1] commit-reach: use unsigned int for flags in paint_down_to_common()
Date: Thu, 13 Feb 2025 00:58:40 +0530	[thread overview]
Message-ID: <20250212192841.8321-2-dhar61595@gmail.com> (raw)
In-Reply-To: <20250212192841.8321-1-dhar61595@gmail.com>

The `flags` variable in `paint_down_to_common()` stores bitwise flags
(PARENT1, PARENT2, and STALE), which are defined as `(1u << N)`.
Since these are already unsigned values,`flags` can also be declared as
`unsigned int` instead of `int`.

Signed-off-by: Moumita <dhar61595@gmail.com>
---
 commit-reach.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commit-reach.c b/commit-reach.c
index a339e41aa4..a4aaae2737 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -79,7 +79,7 @@ static int paint_down_to_common(struct repository *r,
 	while (queue_has_nonstale(&queue)) {
 		struct commit *commit = prio_queue_get(&queue);
 		struct commit_list *parents;
-		int flags;
+		unsigned int flags;
 		timestamp_t generation = commit_graph_generation(commit);
 
 		if (min_generation && generation > last_gen)
-- 
2.48.0


  reply	other threads:[~2025-02-12 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 19:28 [PATCH 0/1] [GSOC] Use unsigned type for bit flags in commit-reach.c Moumita
2025-02-12 19:28 ` Moumita [this message]
2025-02-12 21:16 ` Junio C Hamano

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=20250212192841.8321-2-dhar61595@gmail.com \
    --to=dhar61595@gmail.com \
    --cc=abhishekkumar8222@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=stolee@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