Commit 501834af38124c2210b66fa6705cc0890781b539

Omar Polo 2022-07-02T21:18:05

fix leftovers from long -> int change when changing the line addresses to be int from long the report callaback was forgotten.

diff --git a/got/got.c b/got/got.c
index 4e69daf..955f253 100644
--- a/got/got.c
+++ b/got/got.c
@@ -7756,8 +7756,8 @@ patch_from_stdin(int *patchfd)
 
 static const struct got_error *
 patch_progress(void *arg, const char *old, const char *new,
-    unsigned char status, const struct got_error *error, long old_from,
-    long old_lines, long new_from, long new_lines, long offset,
+    unsigned char status, const struct got_error *error, int old_from,
+    int old_lines, int new_from, int new_lines, int offset,
     int ws_mangled, const struct got_error *hunk_err)
 {
 	const char *path = new == NULL ? old : new;
@@ -7772,12 +7772,12 @@ patch_progress(void *arg, const char *old, const char *new,
 		fprintf(stderr, "%s: %s\n", getprogname(), error->msg);
 
 	if (offset != 0 || hunk_err != NULL || ws_mangled) {
-		printf("@@ -%ld,%ld +%ld,%ld @@ ", old_from,
+		printf("@@ -%d,%d +%d,%d @@ ", old_from,
 		    old_lines, new_from, new_lines);
 		if (hunk_err != NULL)
 			printf("%s\n", hunk_err->msg);
 		else if (offset != 0)
-			printf("applied with offset %ld\n", offset);
+			printf("applied with offset %d\n", offset);
 		else
 			printf("hunk contains mangled whitespace\n");
 	}
diff --git a/include/got_patch.h b/include/got_patch.h
index e72ded7..3d08eea 100644
--- a/include/got_patch.h
+++ b/include/got_patch.h
@@ -22,7 +22,7 @@
  */
 typedef const struct got_error *(*got_patch_progress_cb)(void *,
     const char *, const char *, unsigned char, const struct got_error *,
-    long, long, long, long, long, int, const struct got_error *);
+    int, int, int, int, int, int, const struct got_error *);
 
 /*
  * Apply the (already opened) patch to the repository and register the