Commit 34a29bf7 authored by Frank Barchard's avatar Frank Barchard

fix warning on visual C for mips cpu detect

follow up warning fixs
cpu_id.cc(167): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
lint warning: cpu_id.cc:171:  Missing space before ( in if(  [whitespace/parens] [5]

TBR=manojkumar.bhosale@imgtec.com
BUG=libyuv:634
TEST=try bots for windows.

Review URL: https://codereview.chromium.org/2365813002 .
parent c5323b0f
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
'clang%': 0, 'clang%': 0,
# Link-Time Optimizations. # Link-Time Optimizations.
'use_lto%': 0, 'use_lto%': 0,
'mips_msa%': 0, # Default to msa off.
'build_neon': 0, 'build_neon': 0,
'build_msa': 0, 'build_msa': 0,
'conditions': [ 'conditions': [
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
{ {
'variables': { 'variables': {
'libyuv_disable_jpeg%': 0, 'libyuv_disable_jpeg%': 0,
'mips_msa%': 0, # Default to msa off.
}, },
'targets': [ 'targets': [
{ {
......
...@@ -164,14 +164,14 @@ int ArmCpuCaps(const char* cpuinfo_name) { ...@@ -164,14 +164,14 @@ int ArmCpuCaps(const char* cpuinfo_name) {
LIBYUV_API SAFEBUFFERS LIBYUV_API SAFEBUFFERS
int MipsCpuCaps(const char* cpuinfo_name, const char ase[]) { int MipsCpuCaps(const char* cpuinfo_name, const char ase[]) {
char cpuinfo_line[512]; char cpuinfo_line[512];
int len = strlen(ase); int len = (int)strlen(ase);
FILE* f = fopen(cpuinfo_name, "r"); FILE* f = fopen(cpuinfo_name, "r");
if (!f) { if (!f) {
// ase enabled if /proc/cpuinfo is unavailable. // ase enabled if /proc/cpuinfo is unavailable.
if(strcmp(ase, " msa") == 0) { if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA; return kCpuHasMSA;
} }
if(strcmp(ase, " dspr2") == 0) { if (strcmp(ase, " dspr2") == 0) {
return kCpuHasDSPR2; return kCpuHasDSPR2;
} }
} }
...@@ -180,10 +180,10 @@ int MipsCpuCaps(const char* cpuinfo_name, const char ase[]) { ...@@ -180,10 +180,10 @@ int MipsCpuCaps(const char* cpuinfo_name, const char ase[]) {
char* p = strstr(cpuinfo_line, ase); char* p = strstr(cpuinfo_line, ase);
if (p && (p[len] == ' ' || p[len] == '\n')) { if (p && (p[len] == ' ' || p[len] == '\n')) {
fclose(f); fclose(f);
if(strcmp(ase, " msa") == 0) { if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA; return kCpuHasMSA;
} }
if(strcmp(ase, " dspr2") == 0) { if (strcmp(ase, " dspr2") == 0) {
return kCpuHasDSPR2; return kCpuHasDSPR2;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment