mbox series

[0/1,GSOC] Use unsigned type for bit flags in commit-reach.c

Message ID 20250212192841.8321-1-dhar61595@gmail.com (mailing list archive)
Headers show
Series Use unsigned type for bit flags in commit-reach.c | expand

Message

Moumita Feb. 12, 2025, 7:28 p.m. UTC
The `flags` variable  holds multiple bitwise flags (PARENT1, PARENT2, STALE),these flags are defined using (1u << N), so maybe there will be no issues if it is changed from `int` to `unsigned int`

Moumita (1):
  commit-reach: use unsigned int for flags in paint_down_to_common()

 commit-reach.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Feb. 12, 2025, 9:16 p.m. UTC | #1
Moumita <dhar61595@gmail.com> writes:

> The `flags` variable holds multiple bitwise flags (PARENT1,
> PARENT2, STALE),these flags are defined using (1u << N), so maybe
> there will be no issues if it is changed from `int` to `unsigned
> int`

"This change will not break" is not a good reason to make the
change, though, as not making that change will not break anything,
either.

If you need to write something, say something that positively
justifies the change, explaining readers why it is a good thing to
do, and how the resulting code is _better_ than the original.

Thanks.