From 1c8bf0ecd81cefb01fd0deb911f8f7c4122a146a Mon Sep 17 00:00:00 2001 From: Rashmica Gupta Date: Fri, 27 Apr 2018 11:53:51 +1000 Subject: [PATCH] hwcaps: Change uint32_t to unsigned long getauxval() returns an unsigned long which can be defined to be more than 32 bits so don't force the result into a uint32_t. Signed-off-by: Rashmica Gupta --- include/internal/hwcaps.h | 4 ++-- src/hwcaps.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/internal/hwcaps.h b/include/internal/hwcaps.h index f5f39d6..1d5567e 100644 --- a/include/internal/hwcaps.h +++ b/include/internal/hwcaps.h @@ -113,8 +113,8 @@ CPU_FEATURES_START_CPP_NAMESPACE #endif typedef struct { - uint32_t hwcaps; - uint32_t hwcaps2; + unsigned long hwcaps; + unsigned long hwcaps2; } HardwareCapabilities; HardwareCapabilities CpuFeatures_GetHardwareCapabilities(void); diff --git a/src/hwcaps.c b/src/hwcaps.c index a4a30db..e670bc4 100644 --- a/src/hwcaps.c +++ b/src/hwcaps.c @@ -48,7 +48,7 @@ #if defined(HWCAPS_REGULAR_LINUX) #include #include -static uint32_t GetElfHwcapFromGetauxval(uint32_t hwcap_type) { +static unsigned long GetElfHwcapFromGetauxval(uint32_t hwcap_type) { return getauxval(hwcap_type); } #endif // defined(HWCAPS_REGULAR_LINUX) @@ -136,8 +136,8 @@ static uint32_t GetElfHwcapFromProcSelfAuxv(uint32_t hwcap_type) { // Retrieves hardware capabilities by first trying to call getauxval, if not // available falls back to reading "/proc/self/auxv". -static uint32_t GetHardwareCapabilitiesFor(uint32_t type) { - uint32_t hwcaps = GetElfHwcapFromGetauxval(type); +static unsigned long GetHardwareCapabilitiesFor(uint32_t type) { + unsigned long hwcaps = GetElfHwcapFromGetauxval(type); if (!hwcaps) { D("Parsing /proc/self/auxv to extract ELF hwcaps!\n"); hwcaps = GetElfHwcapFromProcSelfAuxv(type);