All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blame: provide type of fingerprints pointer
@ 2020-02-23 16:56 René Scharfe
  2020-02-24 15:09 ` Barret Rhoden
  0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2020-02-23 16:56 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Barret Rhoden, Junio C Hamano

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blame: provide type of fingerprints pointer
  2020-02-23 16:56 [PATCH] blame: provide type of fingerprints pointer René Scharfe
@ 2020-02-24 15:09 ` Barret Rhoden
  0 siblings, 0 replies; 2+ messages in thread
From: Barret Rhoden @ 2020-02-24 15:09 UTC (permalink / raw)
  To: René Scharfe, Git Mailing List; +Cc: Junio C Hamano

On 2/23/20 11:56 AM, René Scharfe wrote:
> 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.

> 
> 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
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23 16:56 [PATCH] blame: provide type of fingerprints pointer René Scharfe
2020-02-24 15:09 ` Barret Rhoden

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.