Commit b1f2c2e25587e57d4869530b7330d73308f70fe5

Ben Straub 2014-02-22T10:18:42

Prevent icc warning

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/index.c b/src/index.c
index e0c0022..2de3dfe 100644
--- a/src/index.c
+++ b/src/index.c
@@ -2046,13 +2046,15 @@ static int write_index(git_index *index, git_filebuf *file)
 	git_oid hash_final;
 	struct index_header header;
 	bool is_extended;
+	uint32_t index_version_number;
 
 	assert(index && file);
 
 	is_extended = is_index_extended(index);
+	index_version_number = is_extended ? INDEX_VERSION_NUMBER_EXT : INDEX_VERSION_NUMBER;
 
 	header.signature = htonl(INDEX_HEADER_SIG);
-	header.version = htonl(is_extended ? INDEX_VERSION_NUMBER_EXT : INDEX_VERSION_NUMBER);
+	header.version = htonl(index_version_number);
 	header.entry_count = htonl((uint32_t)index->entries.length);
 
 	if (git_filebuf_write(file, &header, sizeof(struct index_header)) < 0)