• Frank Barchard's avatar
    lint warning fixes for CpuID · 7bffe5e1
    Frank Barchard authored
    The CpuId function is a wrapper for the intrinsic, or
    implemented with inline if unavailable.  It had been
    using uint32, but the intrinsics use int, so it was causing
    casting and lint warnings.  This change makes the internal
    implementation use int.
    
    Casting was also done for xgetbv, and the cast is simply
    removed, and is not causing a build error.
    
    MipCpuCaps was doing strlen to check for white space after the
    instruction set.  Arm also does this but with a hard coded offset.
    This was causing a cast from size_t to int, which produced a lint
    warning.  The change removes the white space detect.
    In theory the code could be used to detect SSE vs SSE2, and it would
    need to check SSE is followed by a space or end of line.  But this
    code is only used on Arm and Mips, where there there is one form
    of SIMD detected.  e.g. MSA for mips.  If a new instruction set is
    added with a similar name, the write space check could be reintroduced.
    But its more likely the code can be rewritten to use a better form
    of detection by then. Or remove detection and require the instructions
    
    BUG=libyuv:641
    TEST=try bots build on all platforms without error and lint is clean
    
    Change-Id: I9f55f8e57bba0f78571bdddbe63b945dea3e8809
    Reviewed-on: https://chromium-review.googlesource.com/514524
    Commit-Queue: Frank Barchard <fbarchard@google.com>
    Reviewed-by: 's avatarCheng Wang <wangcheng@google.com>
    Reviewed-by: 's avatarWan-Teh Chang <wtc@chromium.org>
    7bffe5e1
cpuid.c 3.14 KB