diff options
author | Jeff King <peff@peff.net> | 2021-09-20 23:49:49 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-22 11:59:50 -0700 |
commit | 1a845fbc48f2613c0daab717ee934e066e65723d (patch) | |
tree | 610f0b29ca3dd55842b3ca097c812aa2cecff012 /t/t4018/fortran-external-function | |
parent | grep: stop modifying buffer in grep_source_1() (diff) | |
download | tgif-1a845fbc48f2613c0daab717ee934e066e65723d.tar.xz |
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 't/t4018/fortran-external-function')
0 files changed, 0 insertions, 0 deletions