Ticket #3435: mc-cleanup-clang-warnings-06.patch

File mc-cleanup-clang-warnings-06.patch, 1.8 KB (added by and, 9 years ago)
  • src/vfs/smbfs/helpers/lib/util.c

    fix clang 3.6 compiler warnings
    
    patch 01: -Wundef
    patch 02: -Wunused-function
    patch 03: -Wnon-literal-null-conversion
    patch 04: -Wmissing-field-initializers
    patch 05: -Wabsolute-value
    patch 06: -Wtautological-pointer-compare
    patch 07: -Wformat
    
    lib/util.c:345:34: warning: comparison of array 'global_scope' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    libsmb/namequery.c:548:9: warning: comparison of array 'name_resolve_list' equal to a null pointer is always false [-Wtautological-pointer-compare]
    libsmb/nmblib.c:78:36: warning: comparison of array 'res->rdata' equal to a null pointer is always false [-Wtautological-pointer-compare]
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    342342    p[0] = '\0'; 
    343343 
    344344    /* Add the scope string. */ 
    345     for (i = 0, len = 0; NULL != global_scope; i++, len++) 
     345    for (i = 0, len = 0;; i++, len++) 
    346346    { 
    347347        switch (global_scope[i]) 
    348348        { 
  • src/vfs/smbfs/helpers/libsmb/namequery.c

    a b  
    545545    } 
    546546 
    547547    pstrcpy (name_resolve_list, lp_name_resolve_order ()); 
    548     if (name_resolve_list == NULL || *name_resolve_list == '\0') 
     548    if (name_resolve_list[0] == '\0' || *name_resolve_list == '\0') 
    549549        pstrcpy (name_resolve_list, "host"); 
    550550    ptr = name_resolve_list; 
    551551 
  • src/vfs/smbfs/helpers/libsmb/nmblib.c

    a b  
    7575    DEBUGADD (4, ("    %s: nmb_name=%s rr_type=%d rr_class=%d ttl=%d\n", 
    7676                  hdr, nmb_namestr (&res->rr_name), res->rr_type, res->rr_class, res->ttl)); 
    7777 
    78     if (res->rdlength == 0 || res->rdata == NULL) 
     78    if (res->rdlength == 0 || res->rdata[0] == '\0') 
    7979        return; 
    8080 
    8181    for (i = 0; i < res->rdlength; i += 16)