@matheusbsbs / matheus-bagliano / commits / 27f182b3fc
Fork 0

blame: provide type of fingerprints pointer

The fingerprints member of struct blame_origin is a void pointer that is only ever used to reference objects of type struct fingerprint. Declare its type to allow the compiler to do type checks. We can keep its type opaque in blame.h, though -- only functions in blame.c need to know the actual definition of struct fingerprint. Signed-off-by: René Scharfe <l.s.r@web.de> Reviewed-by: Barret Rhoden <brho@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Feb 23, 2020 at 17:56 UTC 27f182b3fc05946ba4f504fc5517252a4b3e9f79
1 file changed +3 -1
blame.h
+3 -1
@@ -16,6 +16,8 @@
16 #define BLAME_DEFAULT_MOVE_SCORE 20
17 #define BLAME_DEFAULT_COPY_SCORE 40
18
19 +struct fingerprint;
20 +
21 /*
22 * One blob in a commit that is being suspected
23 */
@@ -52,7 +54,7 @@ struct blame_origin {
54 struct blame_entry *suspects;
55 mmfile_t file;
56 int num_lines;
55 - void *fingerprints;
57 + struct fingerprint *fingerprints;
58 struct object_id blob_oid;
59 unsigned short mode;
60 /* guilty gets set when shipping any suspects to the final