Two trivial -Wcast-qual fixes
Luiz Fernando N. Capitulino noticed the one in tree-walk.h where we cast away constness while computing the legnth of a tree entry. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 22, 2007 at 23:19 UTC
63daae47e59b72ebec3595ca3e9917e6c595c814
2 files changed
+2
-2
cache-tree.c
+1
-1
@@ -478,7 +478,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
478
if (0 <= it->entry_count) {
479
if (size < 20)
480
goto free_return;
481
- hashcpy(it->sha1, (unsigned char*)buf);
481
+ hashcpy(it->sha1, (const unsigned char*)buf);
482
buf += 20;
483
size -= 20;
484
}
tree-walk.h
+1
-1
@@ -22,7 +22,7 @@ static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, co
22
23
static inline int tree_entry_len(const char *name, const unsigned char *sha1)
24
{
25
- return (char *)sha1 - (char *)name - 1;
25
+ return (const char *)sha1 - name - 1;
26
}
27
28
void update_tree_entry(struct tree_desc *);