threads / patch / 22447

patchbuiltin-name-rev.c: remove the remaining "typedef struct rev_name" from git.

Subject: [PATCH] builtin-name-rev.c: remove the remaining "typedef struct rev_name" from git.

## tl;dr

2 messages between Jan 30, 2010 and Jan 30, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Thiago Farina· Jan 30, 2010, 01:32 UTC · lore
---
 builtin-name-rev.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to builtin-name-rev.c +3 −3
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index 06a38ac..6416f72 100644
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
@@ -7,11 +7,11 @@
 
 #define CUTOFF_DATE_SLOP 86400 /* one day */
 
-typedef struct rev_name {
+struct rev_name {
 	const char *tip_name;
 	int generation;
 	int distance;
-} rev_name;
+};
 
 static long cutoff = LONG_MAX;
 
@@ -43,7 +43,7 @@ static void name_rev(struct commit *commit,
 	}
 
 	if (name == NULL) {
-		name = xmalloc(sizeof(rev_name));
+		name = xmalloc(sizeof(struct rev_name));
 		commit->util = name;
 		goto copy_data;
 	} else if (name->distance > distance) {
-- 
1.6.6.1.436.gaba7d
Stephen Boyd· Jan 30, 2010, 07:53 UTC · re: Thiago Farina · lore

Re: [PATCH] builtin-name-rev.c: remove the remaining "typedef struct rev_name" from git.

On 01/29/2010 05:32 PM, Thiago Farina wrote:
Show 6 quoted lines
> @@ -43,7 +43,7 @@ static void name_rev(struct commit *commit,
>   	}
>
>   	if (name == NULL) {
> -		name = xmalloc(sizeof(rev_name));
> +		name = xmalloc(sizeof(struct rev_name));

How about sizeof(*name) instead? This way we don't have to change it when the type changes again.

← back to recent threads