Skip to content

Commit

Permalink
Two trivial -Wcast-qual fixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jun 23, 2007
1 parent 0ce3964 commit 63daae4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tree-walk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (char *)sha1 - (char *)name - 1;
return (const char *)sha1 - name - 1;
}

void update_tree_entry(struct tree_desc *);
Expand Down

0 comments on commit 63daae4

Please sign in to comment.