summaryrefslogtreecommitdiff
path: root/match-trees.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2019-04-05 15:00:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-08 07:02:07 (GMT)
commit5ec1e72823735b5682389589b6bee774ae70fa49 (patch)
tree3780b0e33a6ddaaf42f7bfca192fc1fced100922 /match-trees.c
parent041f5ea1cf987a4068ef5f39ba0a09be85952064 (diff)
downloadgit-5ec1e72823735b5682389589b6bee774ae70fa49.zip
git-5ec1e72823735b5682389589b6bee774ae70fa49.tar.gz
git-5ec1e72823735b5682389589b6bee774ae70fa49.tar.bz2
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 'match-trees.c')
-rw-r--r--match-trees.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/match-trees.c b/match-trees.c
index ddc4d39..9d1ec8d 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -140,7 +140,7 @@ static void match_trees(const struct object_id *hash1,
while (one.size) {
const char *path;
const struct object_id *elem;
- unsigned mode;
+ unsigned short mode;
int score;
elem = tree_entry_extract(&one, &path, &mode);
@@ -196,7 +196,7 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
rewrite_here = NULL;
while (desc.size) {
const char *name;
- unsigned mode;
+ unsigned short mode;
tree_entry_extract(&desc, &name, &mode);
if (strlen(name) == toplen &&
@@ -285,7 +285,7 @@ void shift_tree(const struct object_id *hash1,
if (add_score < del_score) {
/* We need to pick a subtree of two */
- unsigned mode;
+ unsigned short mode;
if (!*del_prefix)
return;
@@ -313,7 +313,7 @@ void shift_tree_by(const struct object_id *hash1,
const char *shift_prefix)
{
struct object_id sub1, sub2;
- unsigned mode1, mode2;
+ unsigned short mode1, mode2;
unsigned candidate = 0;
/* Can hash2 be a tree at shift_prefix in tree hash1? */