Ticket #4524: 0001-clang-fix-Wconstant-conversion-warning.patch

File 0001-clang-fix-Wconstant-conversion-warning.patch, 1.9 KB (added by zaytsev, 5 months ago)
  • src/filemanager/filegui.c

    From 858023dc075842b87206f508f06d744db489d73c Mon Sep 17 00:00:00 2001
    From: "Yury V. Zaytsev" <yury@shurup.com>
    Date: Thu, 30 May 2024 21:09:12 +0200
    Subject: [PATCH] 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>
    ---
     src/filemanager/filegui.c   | 2 +-
     src/filemanager/fileopctx.c | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c
    index a74806e0f..ff8651bee 100644
    a b file_mask_dialog (file_op_context_t * ctx, gboolean only_one, const char *format 
    14101410            if (preserve) 
    14111411            { 
    14121412                ctx->preserve = TRUE; 
    1413                 ctx->umask_kill = 0777777; 
     1413                ctx->umask_kill = ~umask (0); 
    14141414                ctx->preserve_uidgid = (geteuid () == 0); 
    14151415            } 
    14161416            else 
  • src/filemanager/fileopctx.c

    diff --git a/src/filemanager/fileopctx.c b/src/filemanager/fileopctx.c
    index 72a51bafe..12f7f619e 100644
    a b file_op_context_new (FileOperation op) 
    7878    ctx->stat_func = mc_lstat; 
    7979    ctx->preserve = TRUE; 
    8080    ctx->preserve_uidgid = (geteuid () == 0); 
    81     ctx->umask_kill = 0777777; 
     81    ctx->umask_kill = ~umask (0); 
    8282    ctx->erase_at_end = TRUE; 
    8383    ctx->skip_all = FALSE; 
    8484