Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Two trivial -Wcast-qual fixes
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>
cache-tree.c
patch
|
blob
|
history
tree-walk.h
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
0ce3964
)
diff --git
a/cache-tree.c
b/cache-tree.c
index 350a79b768e7c032e1b4815f7201c9ce5f88bc8d..077f03436941e9c0bf31d3bb2002c1e36b8817b9 100644
(file)
--- a/
cache-tree.c
+++ b/
cache-tree.c
@@
-478,7
+478,7
@@
static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
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
@@
-22,7
+22,7
@@
static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, co
static inline int tree_entry_len(const char *name, const unsigned char *sha1)
{
- return (c
har *)sha1 - (char *)
name - 1;
+ return (c
onst char *)sha1 -
name - 1;
}
void update_tree_entry(struct tree_desc *);