Re: [Newcomer][PATCH] graph.c: change graph_line->width type to int to remove sign-compare warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 21, 2025 at 8:08 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> An obvious question after reading the above explanation is if it
> also would be a valid solution to change the type of git_graph.width
> to match the type of graph_line.width instead.  And if so, what was
> the reason why you chose to match their types in this direction?

While writing the patch, I saw how the git_graph and graph_line structs
related to each other, and understood git_graph as being the "more
important" struct in this context. So, it seemed more reasonable to
have graph_line.width comply with git_graph.width type.

I do see the opposite point, taking notice of graph_line.width interactions
with "size_t". With those in mind, having the type as "size_t" does
also make a lot of sense.

However, considering that:
> "git log --graph" output is certainly something that should not exceed
> thousands for sane people
It feels intuitive to " use platform natural "int" " as you put it.

> By the way, these lines are overly long.  We aim to limit our (physical) line
> length to around 70 chars or so by line wrapping.
Sorry about that, I'll keep them shorter.

Lastly, thanks for the quick and careful response to the patch. As a
first timer
I appreciate the discussion.

- Octavio





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux