• B
    Use ARRAY_SIZE macro · 66fe09ee
    Blue Swirl 提交于
    Replace array size calculations with ARRAY_SIZE macro.
    
    Implemented with this Coccinelle semantic patch, adapted from
    Linux kernel:
    @@
    type T;
    T[] E;
    @@
    
    - (sizeof(E)/sizeof(*E))
    + ARRAY_SIZE(E)
    
    @@
    type T;
    T[] E;
    @@
    
    - (sizeof(E)/sizeof(E[...]))
    + ARRAY_SIZE(E)
    
    @@
    type T;
    T[] E;
    @@
    
    - (sizeof(E)/sizeof(T))
    + ARRAY_SIZE(E)
    
    Some files (*-dis.c, tests/*) had to be filtered out.
    Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
    66fe09ee
os-posix.c 7.6 KB