From: Philip Oakley Date: Wed, 1 Dec 2021 00:29:00 +0000 (+0000) Subject: repack.c: LLP64 compatibility, upcast unity for left shift X-Git-Tag: v2.35.0-rc0~107^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a43abad1e3bfb20864cd3873a4a8b86f845bae1a;p=thirdparty%2Fgit.git repack.c: LLP64 compatibility, upcast unity for left shift Visual Studio reports C4334 "was 64-bit shift intended" warning because of size mismatch. Promote unity to the matching type to fit with the `&` operator. Signed-off-by: Philip Oakley Signed-off-by: Junio C Hamano --- diff --git a/builtin/repack.c b/builtin/repack.c index 0b2d1e5d82..6da66474fd 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -842,7 +842,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) fname_old = mkpathdup("%s-%s%s", packtmp, item->string, exts[ext].name); - if (((uintptr_t)item->util) & (1 << ext)) { + if (((uintptr_t)item->util) & ((uintptr_t)1 << ext)) { struct stat statbuffer; if (!stat(fname_old, &statbuffer)) { statbuffer.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);