range-diff: mark pointers as const
The contents pointed to by `diffopt` and `other_arg` should not be modified. Mark these as `const` to indicate this. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Dec 6, 2019 at 12:16 UTC
f8675343d79058ab5200e93e6c33058e13d7bb43
2 files changed
+5
-5
range-diff.c
+3
-3
@@ -41,7 +41,7 @@ static size_t find_end_of_line(char *buffer, unsigned long size)
41
* as struct object_id (will need to be free()d).
42
*/
43
static int read_patches(const char *range, struct string_list *list,
44
- struct argv_array *other_arg)
44
+ const struct argv_array *other_arg)
45
{
46
struct child_process cp = CHILD_PROCESS_INIT;
47
struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -506,8 +506,8 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
506
507
int show_range_diff(const char *range1, const char *range2,
508
int creation_factor, int dual_color,
509
- struct diff_options *diffopt,
510
- struct argv_array *other_arg)
509
+ const struct diff_options *diffopt,
510
+ const struct argv_array *other_arg)
511
{
512
int res = 0;
513
range-diff.h
+2
-2
@@ -13,7 +13,7 @@
13
*/
14
int show_range_diff(const char *range1, const char *range2,
15
int creation_factor, int dual_color,
16
- struct diff_options *diffopt,
17
- struct argv_array *other_arg);
16
+ const struct diff_options *diffopt,
17
+ const struct argv_array *other_arg);
18
19
#endif