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

[PATCH 2/7] Initialize FAMs using `FLEX_ARRAY'.

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

When initializing a `flexible array member' the macro `FLEX_ARRAY' should be used. This was forgotten in `diff-delta.c'.

Signed-off-by: Florian Forster <octo@verplant.org>
---
 diff-delta.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
e587fd59510f2ed8326d280054d78cfb78d482dc
diff --git a/diff-delta.c b/diff-delta.c
index 25a798d..74486b1 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -22,6 +22,7 @@ #include <stdlib.h>
 #include <string.h>
 #include "delta.h"
 
+#include "git-compat-util.h"
 
 /* maximum hash entry list for the same hash bucket */
 #define HASH_LIMIT 64
@@ -131,7 +132,7 @@ struct delta_index {
 	const void *src_buf;
 	unsigned long src_size;
 	unsigned int hash_mask;
-	struct index_entry *hash[0];
+	struct index_entry *hash[FLEX_ARRAY];
 };
 
 struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
-- 
1.3.3
Previous: Florian ForsterNext: Junio C Hamano
Message 2 of 4 in “Remove ranges from switch statements.”
  1. 1/7 Remove ranges from switch statements.Florian Forster, Jun 18, 2006
  2. 2/7 Initialize FAMs using `FLEX_ARRAY'.Florian Forster, Jun 18, 2006
  3. Junio C HamanoJun 18, 2006
  4. Timo HirvonenJun 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.