diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-03-21 10:08:25 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-21 10:21:57 -0700 |
commit | 6fda5e5180c2e7c130978361aea53b4e66f36823 (patch) | |
tree | 89df3a31883fe84ae06d1c05f29fa823614eef87 /tree-walk.h | |
parent | a8c40471ab0851bf9a58f7dc76f121258e0690e2 (diff) | |
download | git-6fda5e5180c2e7c130978361aea53b4e66f36823.tar.gz |
Initialize tree descriptors with a helper function rather than by hand.
This removes slightly more lines than it adds, but the real reason for
doing this is that future optimizations will require more setup of the
tree descriptor, and so we want to do it in one place.
Also renamed the "desc.buf" field to "desc.buffer" just to trigger
compiler errors for old-style manual initializations, making sure I
didn't miss anything.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tree-walk.h b/tree-walk.h index 149393aaa4..ca0c29fb1a 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -2,8 +2,8 @@ #define TREE_WALK_H struct tree_desc { - const void *buf; - unsigned long size; + const void *buffer; + unsigned int size; }; struct name_entry { @@ -18,6 +18,7 @@ static inline int tree_entry_len(const char *name, const unsigned char *sha1) } void update_tree_entry(struct tree_desc *); +void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size); const unsigned char *tree_entry_extract(struct tree_desc *, const char **, unsigned int *); /* Helper function that does both of the above and returns true for success */ |