Ticket #3607: mc-3607-cleanup-cppcheck-warning-at-direntry.patch

File mc-3607-cleanup-cppcheck-warning-at-direntry.patch, 1.9 KB (added by and, 8 years ago)
  • lib/vfs/direntry.c

    From 756e3c96dff4f70ae673fa4ea40e772e47d8b6c2 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 24 Apr 2016 17:30:37 +0000
    Subject: [PATCH] Cleanup cppcheck warning at direntry.c
    
    Cleanup following cppcheck warnings:
    
    [lib/vfs/direntry.c:121]: (style) Clarify calculation precedence for '&' and '?'.
    [lib/vfs/direntry.c:386]: (style) Clarify calculation precedence for '&' and '?'.
    [lib/vfs/direntry.c:391]: (style) Clarify calculation precedence for '&' and '?'.
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/vfs/direntry.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c
    index 66742b5..72a291c 100644
    a b vfs_s_automake (struct vfs_class *me, struct vfs_s_inode *dir, char *path, int f 
    118118    if (sep != NULL) 
    119119        *sep = '\0'; 
    120120 
    121     res = vfs_s_generate_entry (me, path, dir, flags & FL_MKDIR ? (0777 | S_IFDIR) : 0777); 
     121    res = vfs_s_generate_entry (me, path, dir, (flags & FL_MKDIR) ? (0777 | S_IFDIR) : 0777); 
    122122    vfs_s_insert_entry (me, dir, res); 
    123123 
    124124    if (sep != NULL) 
    vfs_s_inode_from_path (const vfs_path_t * vpath, int flags) 
    383383 
    384384    ino = 
    385385        vfs_s_find_inode (path_element->class, super, q, 
    386                           flags & FL_FOLLOW ? LINK_FOLLOW : LINK_NO_FOLLOW, flags & ~FL_FOLLOW); 
     386                          (flags & FL_FOLLOW) ? LINK_FOLLOW : LINK_NO_FOLLOW, flags & ~FL_FOLLOW); 
    387387    if ((!ino) && (!*q)) 
    388388        /* We are asking about / directory of ftp server: assume it exists */ 
    389389        ino = 
    390390            vfs_s_find_inode (path_element->class, super, q, 
    391                               flags & FL_FOLLOW ? LINK_FOLLOW : 
     391                              (flags & FL_FOLLOW) ? LINK_FOLLOW : 
    392392                              LINK_NO_FOLLOW, FL_DIR | (flags & ~FL_FOLLOW)); 
    393393    return ino; 
    394394}