summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ce3964)
raw | patch | inline | side by side (parent: 0ce3964)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Jun 2007 06:19:43 +0000 (23:19 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Jun 2007 06:19:43 +0000 (23:19 -0700) |
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>
we cast away constness while computing the legnth of a tree
entry.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c | patch | blob | history | |
tree-walk.h | patch | blob | history |
diff --git a/cache-tree.c b/cache-tree.c
index 350a79b768e7c032e1b4815f7201c9ce5f88bc8d..077f03436941e9c0bf31d3bb2002c1e36b8817b9 100644 (file)
--- a/cache-tree.c
+++ b/cache-tree.c
if (0 <= it->entry_count) {
if (size < 20)
goto free_return;
- hashcpy(it->sha1, (unsigned char*)buf);
+ hashcpy(it->sha1, (const unsigned char*)buf);
buf += 20;
size -= 20;
}
diff --git a/tree-walk.h b/tree-walk.h
index ee747aba0bec914bd8f5c7a5285c8395ba5f489b..db0fbdc701f1ef63cdc1a8b7d5c5e72322f91426 100644 (file)
--- a/tree-walk.h
+++ b/tree-walk.h
static inline int tree_entry_len(const char *name, const unsigned char *sha1)
{
- return (char *)sha1 - (char *)name - 1;
+ return (const char *)sha1 - name - 1;
}
void update_tree_entry(struct tree_desc *);