]> git.ipfire.org Git - thirdparty/git.git/commitdiff
range-diff: mark pointers as const
authorDenton Liu <liu.denton@gmail.com>
Fri, 6 Dec 2019 20:16:26 +0000 (12:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 20:34:49 +0000 (12:34 -0800)
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>
range-diff.c
range-diff.h

index f56b4012a284831bd2edefeed141ca8717d219b6..f745567cf6719665cdfd23145335380f36e0c54b 100644 (file)
@@ -41,7 +41,7 @@ static size_t find_end_of_line(char *buffer, unsigned long size)
  * as struct object_id (will need to be free()d).
  */
 static int read_patches(const char *range, struct string_list *list,
-                       struct argv_array *other_arg)
+                       const struct argv_array *other_arg)
 {
        struct child_process cp = CHILD_PROCESS_INIT;
        struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -506,8 +506,8 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
 
 int show_range_diff(const char *range1, const char *range2,
                    int creation_factor, int dual_color,
-                   struct diff_options *diffopt,
-                   struct argv_array *other_arg)
+                   const struct diff_options *diffopt,
+                   const struct argv_array *other_arg)
 {
        int res = 0;
 
index 7d918ab9edcb7206e9a984d934af6f011b631a1b..381d52f4d392e328dc899986bbb8e857cb640890 100644 (file)
@@ -13,7 +13,7 @@
  */
 int show_range_diff(const char *range1, const char *range2,
                    int creation_factor, int dual_color,
-                   struct diff_options *diffopt,
-                   struct argv_array *other_arg);
+                   const struct diff_options *diffopt,
+                   const struct argv_array *other_arg);
 
 #endif