Skip to content

Commit f867534

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 828765d commit f867534

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

range-diff.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static size_t find_end_of_line(char *buffer, unsigned long size)
4141
* as struct object_id (will need to be free()d).
4242
*/
4343
static int read_patches(const char *range, struct string_list *list,
44-
struct argv_array *other_arg)
44+
const struct argv_array *other_arg)
4545
{
4646
struct child_process cp = CHILD_PROCESS_INIT;
4747
struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -506,8 +506,8 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
506506

507507
int show_range_diff(const char *range1, const char *range2,
508508
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)
511511
{
512512
int res = 0;
513513

range-diff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
int show_range_diff(const char *range1, const char *range2,
1515
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);
1818

1919
#endif

0 commit comments

Comments
 (0)