From f70e8a2fe038cddb984c3ee91fadc8f614e752a9 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 29 Jul 2013 21:23:53 +0200 Subject: [PATCH] Android buildfix & retab --- Common/ArmCPUDetect.cpp | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Common/ArmCPUDetect.cpp b/Common/ArmCPUDetect.cpp index 6924376692..f5d01b74ea 100644 --- a/Common/ArmCPUDetect.cpp +++ b/Common/ArmCPUDetect.cpp @@ -18,6 +18,7 @@ #include "Common.h" #include "CPUDetect.h" #include "StringUtils.h" +#include "FileUtil.h" // Only Linux platforms have /proc/cpuinfo #if !defined(BLACKBERRY) && !defined(IOS) && !defined(__SYMBIAN32__) @@ -51,51 +52,50 @@ char *GetCPUString() unsigned char GetCPUImplementer() { - const char marker[] = "CPU implementer\t: "; - char *implementer_string = 0; - unsigned char implementer = 0; - char buf[1024]; + const char marker[] = "CPU implementer\t: "; + char *implementer_string = 0; + unsigned char implementer = 0; + char buf[1024]; - File::IOFile file(procfile, "r"); - auto const fp = file.GetHandle(); - if (!fp) - return 0; + File::IOFile file(procfile, "r"); + auto const fp = file.GetHandle(); + if (!fp) + return 0; - while (fgets(buf, sizeof(buf), fp)) - { - if (strncmp(buf, marker, sizeof(marker) - 1)) - continue; - implementer_string = buf + sizeof(marker) - 1; - implementer_string = strndup(implementer_string, strlen(implementer_string) - 1); // Strip the newline - sscanf(implementer_string, "0x%02hhx", &implementer); - break; - } - return implementer; + while (fgets(buf, sizeof(buf), fp)) + { + if (strncmp(buf, marker, sizeof(marker) - 1)) + continue; + implementer_string = buf + sizeof(marker) - 1; + implementer_string = strndup(implementer_string, strlen(implementer_string) - 1); // Strip the newline + sscanf(implementer_string, "0x%02hhx", &implementer); + break; + } + return implementer; } unsigned short GetCPUPart() { - const char marker[] = "CPU part\t: "; - char *part_string = 0; - unsigned short part = 0; - char buf[1024]; + const char marker[] = "CPU part\t: "; + char *part_string = 0; + unsigned short part = 0; + char buf[1024]; - File::IOFile file(procfile, "r"); - auto const fp = file.GetHandle(); - if (!fp) - return 0; - - while (fgets(buf, sizeof(buf), fp)) - { - if (strncmp(buf, marker, sizeof(marker) - 1)) - continue; - part_string = buf + sizeof(marker) - 1; - part_string = strndup(part_string, strlen(part_string) - 1); // Strip the newline - sscanf(part_string, "0x%03hx", &part); - break; - } - return part; + File::IOFile file(procfile, "r"); + auto const fp = file.GetHandle(); + if (!fp) + return 0; + while (fgets(buf, sizeof(buf), fp)) + { + if (strncmp(buf, marker, sizeof(marker) - 1)) + continue; + part_string = buf + sizeof(marker) - 1; + part_string = strndup(part_string, strlen(part_string) - 1); // Strip the newline + sscanf(part_string, "0x%03hx", &part); + break; + } + return part; } bool CheckCPUFeature(const char *feature)