{"thread":{"id":"52874","subject":"[PATCH] blame: provide type of fingerprints pointer","startedAt":"2020-02-23T16:56:59Z","lastAt":"2020-02-24T15:09:51Z","messageCount":2,"participants":["René Scharfe","Barret Rhoden"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"392358","messageId":"22735441-50e1-5f00-ba12-539b3e9e4916@web.de","threadId":"52874","inReplyTo":null,"subject":"[PATCH] blame: provide type of fingerprints pointer","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-02-23T16:56:31Z","receivedAt":"2020-02-23T16:56:59Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The fingerprints member of struct blame_origin is a void pointer that is\nonly ever used to reference objects of type struct fingerprint.  Declare\nits type to allow the compiler to do type checks.  We can keep its type\nopaque in blame.h, though -- only functions in blame.c need to know the\nactual definition of struct fingerprint.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n blame.h | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/blame.h b/blame.h\nindex 4a9e1270b0..089b181ff2 100644\n--- a/blame.h\n+++ b/blame.h\n@@ -16,6 +16,8 @@\n #define BLAME_DEFAULT_MOVE_SCORE\t20\n #define BLAME_DEFAULT_COPY_SCORE\t40\n\n+struct fingerprint;\n+\n /*\n  * One blob in a commit that is being suspected\n  */\n@@ -52,7 +54,7 @@ struct blame_origin {\n \tstruct blame_entry *suspects;\n \tmmfile_t file;\n \tint num_lines;\n-\tvoid *fingerprints;\n+\tstruct fingerprint *fingerprints;\n \tstruct object_id blob_oid;\n \tunsigned short mode;\n \t/* guilty gets set when shipping any suspects to the final\n--\n2.25.1\n"},{"id":"392406","messageId":"ddaa7ab8-c07b-7718-815f-12ff048a89f7@google.com","threadId":"52874","inReplyTo":"22735441-50e1-5f00-ba12-539b3e9e4916@web.de","subject":"Re: [PATCH] blame: provide type of fingerprints pointer","fromName":"Barret Rhoden","fromEmail":"brho@google.com","sentAt":"2020-02-24T15:09:45Z","receivedAt":"2020-02-24T15:09:51Z","isPatch":true,"sender":{"key":"brho@google.com","avatar":null},"body":"On 2/23/20 11:56 AM, René Scharfe wrote:\n> The fingerprints member of struct blame_origin is a void pointer that is\n> only ever used to reference objects of type struct fingerprint.  Declare\n> its type to allow the compiler to do type checks.  We can keep its type\n> opaque in blame.h, though -- only functions in blame.c need to know the\n> actual definition of struct fingerprint.\n\nReviewed-by: Barret Rhoden <brho@google.com>\n\nThanks.\n\n> \n> Signed-off-by: René Scharfe <l.s.r@web.de>\n> ---\n>   blame.h | 4 +++-\n>   1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/blame.h b/blame.h\n> index 4a9e1270b0..089b181ff2 100644\n> --- a/blame.h\n> +++ b/blame.h\n> @@ -16,6 +16,8 @@\n>   #define BLAME_DEFAULT_MOVE_SCORE\t20\n>   #define BLAME_DEFAULT_COPY_SCORE\t40\n> \n> +struct fingerprint;\n> +\n>   /*\n>    * One blob in a commit that is being suspected\n>    */\n> @@ -52,7 +54,7 @@ struct blame_origin {\n>   \tstruct blame_entry *suspects;\n>   \tmmfile_t file;\n>   \tint num_lines;\n> -\tvoid *fingerprints;\n> +\tstruct fingerprint *fingerprints;\n>   \tstruct object_id blob_oid;\n>   \tunsigned short mode;\n>   \t/* guilty gets set when shipping any suspects to the final\n> --\n> 2.25.1\n> \n\n"}]}