Re: [PATCH 2/2] grep: mark "haystack" buffers as const
- From
Jeff King <peff@peff.net>
- Date
- Sep 21, 2021, 02:05 UTC
- Message-ID
- <YUk9+p1j3GNwZ1DL@coredump.intra.peff.net>
- In-Reply-To
- <YUk4vnMQHApY99Lb@coredump.intra.peff.net>
On Mon, Sep 20, 2021 at 09:43:26PM -0400, Jeff King wrote:
> When we're grepping in a buffer, we don't need to modify it. So we can > take "const char *" buffers, rather than "char *". This can avoid some > awkward casts in our callers.
Sorry, this patch should have touched strip_timestamp(), too. I had originally done it in the earlier patch, but because we pass a pointer-to-pointer, the compiler got mad about the mis-matched type from the caller. So I reverted it there, but forgot to add it back in here.
At any rate, these are mostly for illustration. They'd need a little rebasing if not put on top of your patches anyway.
-Peff