Re: [PATCH v5 05/16] bisect--helper: make `terms` an explicit singleton
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2022, 17:47 UTC
- Message-ID
- <xmqqedwzndqm.fsf@gitster.g>
- In-Reply-To
- <220829.86o7w32vv2.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 21 quoted lines
> On Sat, Aug 27 2022, Johannes Schindelin via GitGitGadget wrote: > >> From: Johannes Schindelin <johannes.schindelin@gmx.de> >> [...] >> - free((void *)terms->term_good); >> - terms->term_good = xstrdup(good); >> - free((void *)terms->term_bad); >> - terms->term_bad = xstrdup(bad); >> + free((void *)terms.term_good); >> + terms.term_good = xstrdup(good); >> + free((void *)terms.term_bad); >> + terms.term_bad = xstrdup(bad); >> } > > This is pre-existing, and dates back to 0f30233a11f (bisect--helper: > `bisect_write` shell function in C, 2019-01-02), but it appears this > cast to a "void *" was never needed. Perhaps some C++-ism that crept in > here? > > As we're changing this all around perhaps it's worth droppping the cast, > or it could be left for some other "remove redundant casts" series.
Nice to notice it. I suspect that at some point in the evolution of the offending patch in 2019 the members were of type "const char *" and needed to cast the constness away, or something, perhaps?
In any case, such a change belongs to either preliminary clean-up before the series, or post clean-up after the dust settles, not something we'd want to see "while we are at it" to distract us.