From: Chris Blume Date: Wed, 13 Feb 2019 01:35:10 +0000 (-0800) Subject: ARMv7 NEON: #ifdef unused funcs/vars w/ -mfpu=neon X-Git-Tag: 2.0.3~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b46af82cc159bbd05312417d003cfab67c340156;p=libjpeg-turbo ARMv7 NEON: #ifdef unused funcs/vars w/ -mfpu=neon When simd/arm/jsimd.c is compiled with __ARM_NEON__ defined (which will be the case if -mfpu=neon is passed to the compiler), the parse_proc_cpuinfo() and check_feature() functions and the bufsize variable are unused and thus need to be #ifdef'ed out in order to avoid compiler warnings. Note that the bufsize variable was already #ifdef'ed out on Linux but not on Android due to lack of parentheses (&& takes precedence over ||.) Closes #331 --- diff --git a/simd/arm/jsimd.c b/simd/arm/jsimd.c index 0fb8197..45f9b04 100644 --- a/simd/arm/jsimd.c +++ b/simd/arm/jsimd.c @@ -5,6 +5,7 @@ * Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies). * Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander. * Copyright (C) 2015-2016, 2018, Matthieu Darbois. + * Copyright (C) 2019, Google LLC. * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -30,7 +31,7 @@ static unsigned int simd_support = ~0; static unsigned int simd_huffman = 1; -#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) +#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)) #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024) @@ -105,7 +106,7 @@ init_simd(void) #ifndef NO_GETENV char *env = NULL; #endif -#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) +#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)) int bufsize = 1024; /* an initial guess for the line buffer size limit */ #endif