git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git: remove unneeded casts

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2022, 01:07 UTC
Message-ID
<xmqqo7s0urpe.fsf@gitster.g>
In-Reply-To
<Y53E7PNu05VTdvXG@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> ... So perhaps:
>
>   - this used to be "char **argv" because of main(), but either because
>     of becoming a builtin or cmd_main() it is now const
>
>   - this used to require casting from non-const to const to free()
>
>   - etc, with one-offs for cases that don't fit in any group
>
> The keeps a single patch's explanation from being too overwhelming, and
> avoids repeating yourself when the same logic applies to multiple cases.

Thanks, that would be the organization I would use, too, if I were doing this change myself.

> That said, I am happy with any solution that explains why we are sure
> each case is OK to do. :)
Yup.
Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 5 of 8 in “git: remove unneeded casts”
  1. git: remove unneeded castsRose via GitGitGadget, Dec 14, 2022
  2. Jeff KingDec 14, 2022
  3. Junio C HamanoDec 14, 2022
  4. Jeff KingDec 17, 2022
  5. Junio C HamanoDec 19, 2022
  6. Ævar Arnfjörð BjarmasonDec 15, 2022
  7. Jeff KingDec 17, 2022
  8. Phillip WoodDec 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.