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

File mc-cleanup-clang-warnings-05.patch, 1.2 KB (added by and, 10 years ago)
  • src/editor/edit.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
    
    edit.c:700:13: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
    editcmd.c:2350:21: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    697697    { 
    698698        long n; 
    699699 
    700         n = abs (edit->line_numbers[i] - line); 
     700        n = labs (edit->line_numbers[i] - line); 
    701701        if (n < m) 
    702702        { 
    703703            m = n; 
  • src/editor/editcmd.c

    a b  
    23472347    { 
    23482348        long col_delta; 
    23492349 
    2350         col_delta = abs (edit->column2 - edit->column1); 
     2350        col_delta = labs (edit->column2 - edit->column1); 
    23512351        edit_insert_column_of_text (edit, copy_buf, size, col_delta, &mark1, &mark2, &c1, &c2); 
    23522352    } 
    23532353    else