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

[PATCH 4/7] Cast pointers to `void *' when used in a format.

From
FFFlorian Forster <octo@verplant.org>
Date
Jun 18, 2006, 15:18 UTC
Message-ID
<11506438893167-git-send-email-octo@verplant.org>
In-Reply-To
<11506438892551-git-send-email-octo@verplant.org>

ANSI C99 requires void-pointers when using the `%p' format. This patch adds the neccessary cast in `blame.c'.

Signed-off-by: Florian Forster <octo@verplant.org>
---
 blame.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
372bb52dd567d39c3e64919e100ae9bd8af603ca
diff --git a/blame.c b/blame.c
index 25d3bcf..51eab2e 100644
--- a/blame.c
+++ b/blame.c
@@ -301,9 +301,9 @@ static void fill_line_map(struct commit 
 				if (DEBUG)
 					printf("map: i1: %d %d %p i2: %d %d %p\n",
 					       i1, map[i1],
-					       i1 != -1 ? blame_lines[map[i1]] : NULL,
+					       (void *) (i1 != -1 ? blame_lines[map[i1]] : NULL),
 					       i2, map2[i2],
-					       i2 != -1 ? blame_lines[map2[i2]] : NULL);
+					       (void *) (i2 != -1 ? blame_lines[map2[i2]] : NULL));
 				if (map2[i2] != -1 &&
 				    blame_lines[map[i1]] &&
 				    !blame_lines[map2[i2]])
-- 
1.3.3
Previous: Florian ForsterNext: Florian Forster
Message 2 of 3 in “Don't instantiate structures with FAMs.”
  1. 3/7 Don't instantiate structures with FAMs.Florian Forster, Jun 18, 2006
  2. 4/7 Cast pointers to `void *' when used in a format.Florian Forster, Jun 18, 2006
  3. 5/7 Don't use empty structure initializers.Florian Forster, Jun 18, 2006

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.