clang: fix -Wconstant-conversion warning

../../../src/filemanager/filegui.c:1413:35: warning: implicit conversion from 'int' to 'mode_t' (aka 'unsigned short') changes value from 262143 to 65535 [-Wconstant-conversion]
                ctx->umask_kill = 0777777;
                                ~ ^~~~~~~

../../../src/filemanager/fileopctx.c:81:23: warning: implicit conversion from 'int' to 'mode_t' (aka 'unsigned short') changes value from 262143 to 65535 [-Wconstant-conversion]
    ctx->umask_kill = 0777777;
                    ~ ^~~~~~~

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Yury V. Zaytsev 2024-05-30 21:09:12 +02:00 committed by Andrew Borodin
parent de06f36ccf
commit ce299bbee9
2 changed files with 3 additions and 3 deletions

View File

@ -1410,7 +1410,7 @@ file_mask_dialog (file_op_context_t * ctx, gboolean only_one, const char *format
if (preserve)
{
ctx->preserve = TRUE;
ctx->umask_kill = 0777777;
ctx->umask_kill = (mode_t) (~0);
ctx->preserve_uidgid = (geteuid () == 0);
}
else
@ -1420,7 +1420,7 @@ file_mask_dialog (file_op_context_t * ctx, gboolean only_one, const char *format
ctx->preserve = ctx->preserve_uidgid = FALSE;
i2 = umask (0);
umask (i2);
ctx->umask_kill = i2 ^ 0777777;
ctx->umask_kill = i2 ^ ((mode_t) (~0));
}
if (*dest_dir == '\0')

View File

@ -78,7 +78,7 @@ file_op_context_new (FileOperation op)
ctx->stat_func = mc_lstat;
ctx->preserve = TRUE;
ctx->preserve_uidgid = (geteuid () == 0);
ctx->umask_kill = 0777777;
ctx->umask_kill = (mode_t) (~0);
ctx->erase_at_end = TRUE;
ctx->skip_all = FALSE;