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

[PATCH 1/3] name-rev: lose unnecessary typedef

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2012, 21:17 UTC
Message-ID
<1346275044-10171-2-git-send-email-gitster@pobox.com>
In-Reply-To
<1346275044-10171-1-git-send-email-gitster@pobox.com>

Just spell it "struct rev_name"; it makes it more clear what is going on.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/name-rev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 1b37458..8af2cfa 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.7.12.285.ga3d5fc0
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 19 in “Funny 'git describe --contains' output”
  1. Greg KHAug 29, 2012
  2. Junio C HamanoAug 29, 2012
  3. Junio C HamanoAug 29, 2012
  4. Greg KHAug 29, 2012
  5. 0/3 "git name-rev --weight"Junio C Hamano, Aug 29, 2012
  6. 1/3 name-rev: lose unnecessary typedefJunio C Hamano, Aug 29, 2012
  7. 2/3 name_rev: clarify when a new tip-name is assigned to a commitJunio C Hamano, Aug 29, 2012
  8. 3/3 name-rev: --weight option (WIP)Junio C Hamano, Aug 29, 2012
  9. Junio C HamanoAug 29, 2012
  10. Jeff KingAug 30, 2012
  11. Junio C HamanoAug 30, 2012
  12. Jeff KingAug 30, 2012
  13. Junio C HamanoAug 30, 2012
  14. Junio C HamanoAug 30, 2012
  15. Junio C HamanoAug 30, 2012
  16. Jeff KingAug 30, 2012
  17. Junio C HamanoAug 30, 2012
  18. Philip OakleyAug 30, 2012
  19. Junio C HamanoAug 30, 2012

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.