diff --git a/src/diff.c b/src/diff.c index 1d39f90..75af70d 100644 --- a/src/diff.c +++ b/src/diff.c @@ -161,7 +161,7 @@ const char *stripped (const char *name, int num_components) unsigned long calculate_num_lines (const char *atatline, char which) { - char *p = strchr (atatline, which); + const char *p = strchr (atatline, which); if (!p) return 1; while (*p && *p != ',' && *p != ' ') p++; @@ -189,7 +189,7 @@ int read_atatline (const char *atatline, { char *endptr; unsigned long res; - char *p; + const char *p; if (orig_offset) { p = strchr (atatline, '-'); diff --git a/src/patch_scanner.c b/src/patch_scanner.c index e9971b6..5ac07e3 100644 --- a/src/patch_scanner.c +++ b/src/patch_scanner.c @@ -1123,7 +1123,7 @@ static int scanner_emit_hunk_header(patch_scanner_t *scanner, const char *line) { char *endptr; unsigned long res; - char *p; + const char *p; const char *context_start; /* Parse @@ -[,] +[,] @@[] */ diff --git a/src/rediff.c b/src/rediff.c index 10e6765..7a4546f 100644 --- a/src/rediff.c +++ b/src/rediff.c @@ -265,7 +265,7 @@ static void copy_to (struct hunk *from, struct hunk *upto, } /* Deal with an added hunk. */ -static long added_hunk (const char *meta, long offset, FILE *modify, FILE *t, +static long added_hunk (char *meta, long offset, FILE *modify, FILE *t, unsigned long morig_count, unsigned long mnew_count) { long this_offset = 0; diff --git a/src/util.c b/src/util.c index 49d2f5f..6393017 100644 --- a/src/util.c +++ b/src/util.c @@ -253,7 +253,7 @@ FILE *xopen_seekable (const char *name, const char *mode) /* unzip if needed */ FILE *xopen_unzip (const char *name, const char *mode) { - char *p, *zprog = NULL; + const char *p, *zprog = NULL; FILE *fi, *fo; const size_t buflen = 64 * 1024; char *buffer; @@ -602,7 +602,7 @@ char patch_determine_file_status(const struct patch_headers *headers, int empty_ /* Parse hunk headers from the patch to determine if files are empty */ for (unsigned int i = 0; i < headers->num_headers; i++) { - const char *line = headers->header_lines[i]; + char *line = headers->header_lines[i]; /* Look for unified diff hunk headers: @@ -offset,count +offset,count @@ */ if (strncmp(line, "@@ ", 3) == 0) {