Commit Diff


commit - 8fbe07c208c126ce38d8d97079ef34df4a41cbc6
commit + 83290b45b037bedb9c814d4afaf111edb4ab7754
blob - 9f0da90a467ec828ff8f59f96b9d6559812554dc
blob + fc01cc37b202d4d82745b7a8b29bb35f2fc71a04
--- lib/diffreg.c
+++ lib/diffreg.c
@@ -186,7 +186,7 @@ static int	 change(FILE *, struct got_diff_changes *, 
 static void	 sort(struct line *, int);
 static void	 print_header(FILE *, struct got_diff_state *, struct got_diff_args *, const char *, const char *);
 static int	 asciifile(FILE *);
-static int	 fetch(FILE *, struct got_diff_state *, struct got_diff_args *, long *, int, int, FILE *, int, int);
+static void	 fetch(FILE *, struct got_diff_state *, struct got_diff_args *, long *, int, int, FILE *, int, int);
 static int	 newcand(struct got_diff_state *, int, int, int, int *);
 static int	 search(struct got_diff_state *, int *, int, int);
 static int	 skipline(FILE *);
@@ -921,8 +921,6 @@ change(FILE *outfile, struct got_diff_changes *changes
     const char *file1, FILE *f1, const char *file2, FILE *f2,
     int a, int b, int c, int d, int *pflags)
 {
-	int i;
-
 	if (a > b && c > d)
 		return (0);
 
@@ -985,19 +983,19 @@ change(FILE *outfile, struct got_diff_changes *changes
 		if (a <= b && c <= d)
 			diff_output(outfile, "---\n");
 	}
-	i = fetch(outfile, ds, args, ds->ixnew, c, d, f2,
+	fetch(outfile, ds, args, ds->ixnew, c, d, f2,
 	    args->diff_format == D_NORMAL ? '>' : '\0', *pflags);
 	return (0);
 }
 
-static int
+static void
 fetch(FILE *outfile, struct got_diff_state *ds, struct got_diff_args *args,
     long *f, int a, int b, FILE *lb, int ch, int flags)
 {
 	int i, j, c, col, nc;
 
 	if (a > b)
-		return (0);
+		return;
 	for (i = a; i <= b; i++) {
 		fseek(lb, f[i - 1], SEEK_SET);
 		nc = f[i] - f[i - 1];
@@ -1014,7 +1012,7 @@ fetch(FILE *outfile, struct got_diff_state *ds, struct
 			if ((c = getc(lb)) == EOF) {
 				diff_output(outfile, "\n\\ No newline at end of "
 				    "file\n");
-				return (0);
+				return;
 			}
 			if (c == '\t' && (flags & D_EXPANDTABS)) {
 				do {
@@ -1026,7 +1024,6 @@ fetch(FILE *outfile, struct got_diff_state *ds, struct
 			}
 		}
 	}
-	return (0);
 }
 
 /*