diff options
author | Elijah Newren <newren@gmail.com> | 2019-04-05 17:00:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-08 09:02:07 +0200 |
commit | 5ec1e72823735b5682389589b6bee774ae70fa49 (patch) | |
tree | 3780b0e33a6ddaaf42f7bfca192fc1fced100922 /tree-walk.h | |
parent | The third batch (diff) | |
download | git-5ec1e72823735b5682389589b6bee774ae70fa49.tar.xz git-5ec1e72823735b5682389589b6bee774ae70fa49.zip |
Use 'unsigned short' for mode, like diff_filespec does
struct diff_filespec defines mode to be an 'unsigned short'. Several
other places in the API which we'd like to interact with using a
diff_filespec used a plain unsigned (or unsigned int). This caused
problems when taking addresses, so switch to unsigned short.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tree-walk.h b/tree-walk.h index 8225171866..3aa381b6a3 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -16,7 +16,7 @@ struct tree_desc { unsigned int size; }; -static inline const struct object_id *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned int *modep) +static inline const struct object_id *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned short *modep) { *pathp = desc->entry.path; *modep = desc->entry.mode; @@ -51,7 +51,7 @@ struct traverse_info; typedef int (*traverse_callback_t)(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *); int traverse_trees(struct index_state *istate, int n, struct tree_desc *t, struct traverse_info *info); -enum get_oid_result get_tree_entry_follow_symlinks(struct object_id *tree_oid, const char *name, struct object_id *result, struct strbuf *result_path, unsigned *mode); +enum get_oid_result get_tree_entry_follow_symlinks(struct object_id *tree_oid, const char *name, struct object_id *result, struct strbuf *result_path, unsigned short *mode); struct traverse_info { const char *traverse_path; @@ -66,7 +66,7 @@ struct traverse_info { int show_all_errors; }; -int get_tree_entry(const struct object_id *, const char *, struct object_id *, unsigned *); +int get_tree_entry(const struct object_id *, const char *, struct object_id *, unsigned short *); extern char *make_traverse_path(char *path, const struct traverse_info *info, const struct name_entry *n); extern void setup_traverse_info(struct traverse_info *info, const char *base); |