aboutsummaryrefslogtreecommitdiff
path: root/util/cpuid.c
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2017-05-25 11:36:06 -0700
committerCommit Bot <commit-bot@chromium.org>2017-05-25 22:00:17 +0000
commit7bffe5e1c54bc22daebd57003735e61693719ac6 (patch)
tree1d7082355eef461021e0ce524e4bb2e7e1b88bc9 /util/cpuid.c
parentae7e2ef13ed464545a153321f377e71be9b38724 (diff)
downloadlibyuv-7bffe5e1c54bc22daebd57003735e61693719ac6.tar.gz
lint warning fixes for CpuID
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: Cheng Wang <wangcheng@google.com> Reviewed-by: Wan-Teh Chang <wtc@chromium.org>
Diffstat (limited to 'util/cpuid.c')
-rw-r--r--util/cpuid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cpuid.c b/util/cpuid.c
index 9716f115..ec0217a6 100644
--- a/util/cpuid.c
+++ b/util/cpuid.c
@@ -25,7 +25,7 @@ int main(int argc, const char* argv[]) {
#if defined(__i386__) || defined(__x86_64__) || \
defined(_M_IX86) || defined(_M_X64)
if (has_x86) {
- uint32 family, model, cpu_info[4];
+ int family, model, cpu_info[4];
// Vendor ID:
// AuthenticAMD AMD processor
// CentaurHauls Centaur processor