path: root/builtin
diff options
authorElijah Newren <>2019-04-05 15:00:12 (GMT)
committerJunio C Hamano <>2019-04-08 07:02:07 (GMT)
commit5ec1e72823735b5682389589b6bee774ae70fa49 (patch)
tree3780b0e33a6ddaaf42f7bfca192fc1fced100922 /builtin
parent041f5ea1cf987a4068ef5f39ba0a09be85952064 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin')
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index db85b33..90cbe89 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -110,7 +110,7 @@ static int check_local_mod(struct object_id *head, int index_only)
const struct cache_entry *ce;
const char *name = list.entry[i].name;
struct object_id oid;
- unsigned mode;
+ unsigned short mode;
int local_changes = 0;
int staged_changes = 0;
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 1b6c42f..0baf51c 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -597,7 +597,7 @@ static struct cache_entry *read_one_ent(const char *which,
struct object_id *ent, const char *path,
int namelen, int stage)
- unsigned mode;
+ unsigned short mode;
struct object_id oid;
struct cache_entry *ce;