summaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-09-20 23:49:49 -0400
committerJunio C Hamano <gitster@pobox.com>2021-09-22 11:59:50 -0700
commit1a845fbc48f2613c0daab717ee934e066e65723d (patch)
tree610f0b29ca3dd55842b3ca097c812aa2cecff012 /grep.h
parentf84e79ff4bffbcd9de85adc270f5164a6b024d34 (diff)
grep: mark "haystack" buffers as const
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, and make our expectations more clear (we will not take ownership of the memory, nor will we ever write to it). These spots don't all necessarily have to be converted at the same time, but some of them are dependent on others, because we pass pointers-to-pointers in a few cases. And none of this should change any behavior, since we're just adding "const" qualifiers (and likewise, the compiler will let us know if we missed any spots). So it's relatively low-risk to just do this all at once. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
0 files changed, 0 insertions, 0 deletions