Re: [PATCH 3/7] grep: typesafe versions of grep_source_init

2 messages, 2 authors, 2021-08-13 · open the first message on its own page

Re: [PATCH 3/7] grep: typesafe versions of grep_source_init

From: Junio C Hamano <hidden>
Date: 2021-08-12 16:50:03

Matheus Tavares Bernardino [off-list ref] writes:
On Tue, Aug 10, 2021 at 3:29 PM Jonathan Tan [off-list ref] wrote:
quoted
diff --git a/grep.c b/grep.c
index 424a39591b..ba3711dc56 100644
--- a/grep.c
+++ b/grep.c
@@ -1830,7 +1830,7 @@ int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size)
        struct grep_source gs;
        int r;

-       grep_source_init(&gs, GREP_SOURCE_BUF, NULL, NULL, NULL);
+       grep_source_init_buf(&gs);
        gs.buf = buf;
        gs.size = size;
Small nit: perhaps `grep_source_init_buf()` could take `buf` and
`size` too, so that all the fields get initialized by the same
function.
Sounds sensible.  Thanks.

Re: [PATCH 3/7] grep: typesafe versions of grep_source_init

From: Jonathan Tan <hidden>
Date: 2021-08-13 16:33:25

quoted
Small nit: perhaps `grep_source_init_buf()` could take `buf` and
`size` too, so that all the fields get initialized by the same
function.
Sounds sensible.  Thanks.
Makes sense - I'll do this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help