git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] blame: provide type of fingerprints pointer

From
BRBarret Rhoden <brho@google.com>
Date
Feb 24, 2020, 15:09 UTC
Message-ID
<ddaa7ab8-c07b-7718-815f-12ff048a89f7@google.com>
In-Reply-To
<22735441-50e1-5f00-ba12-539b3e9e4916@web.de>
On 2/23/20 11:56 AM, René Scharfe wrote:
Show 5 quoted lines
> 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.
Reviewed-by: Barret Rhoden <brho@google.com>
Thanks.
Show 31 quoted lines
> 
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
>   blame.h | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/blame.h b/blame.h
> index 4a9e1270b0..089b181ff2 100644
> --- a/blame.h
> +++ b/blame.h
> @@ -16,6 +16,8 @@
>   #define BLAME_DEFAULT_MOVE_SCORE	20
>   #define BLAME_DEFAULT_COPY_SCORE	40
> 
> +struct fingerprint;
> +
>   /*
>    * One blob in a commit that is being suspected
>    */
> @@ -52,7 +54,7 @@ struct blame_origin {
>   	struct blame_entry *suspects;
>   	mmfile_t file;
>   	int num_lines;
> -	void *fingerprints;
> +	struct fingerprint *fingerprints;
>   	struct object_id blob_oid;
>   	unsigned short mode;
>   	/* guilty gets set when shipping any suspects to the final
> --
> 2.25.1
> 
Previous: René Scharfe
Message 2 of 2 in “blame: provide type of fingerprints pointer”
  1. blame: provide type of fingerprints pointerRené Scharfe, Feb 23, 2020
  2. Barret RhodenFeb 24, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.