[vlc-devel] [PATCH 1/4] cpu: revector (nonfunctional change)

Rémi Denis-Courmont remi at remlab.net
Mon Mar 30 10:30:42 CEST 2020


This uses the same type as the calling function (vlc_CPU) returning the same value. I'm not going explain such basic fact in commit logs.

Le 30 mars 2020 10:40:58 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>On 2020-03-30 9:27, Rémi Denis-Courmont wrote:
>> I'm not changing the type here. And VLC code assumes unsigned is no 
>> smaller than uint32_t (which is correct in POSIX and all supported 
>> non-POSIX platforms).
>
>If the variable was stored in a uint32_t rather than an unsigned there 
>might be a reason. Using a bigger type is probably OK. But I don't see 
>any explanation in the patch. And it doesn't qualify as a nonfunctional
>
>change to me.
>
>> Le 30 mars 2020 09:21:05 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a
>
>> écrit :
>> 
>>     On 2020-03-29 22:43, Rémi Denis-Courmont wrote:
>> 
>>        
>------------------------------------------------------------------------
>>         src/misc/cpu.c | 15 +++++++++------
>>         1 file changed, 9 insertions(+), 6 deletions(-)
>> 
>>         diff --git a/src/misc/cpu.c b/src/misc/cpu.c
>>         index d42d7ed066..8a8835b79b 100644
>>         --- a/src/misc/cpu.c
>>         +++ b/src/misc/cpu.c
>>         @@ -55,8 +55,6 @@
>>         #include <machine/cpu.h>
>>         #endif
>> 
>>         -static uint32_t cpu_flags;
>>         -
>>         #if defined (__i386__) || defined (__x86_64__) || defined
>>         (__powerpc__) \
>>         || defined (__ppc__) || defined (__ppc64__) || defined
>>         (__powerpc64__)
>>         # if defined (HAVE_FORK)
>>         @@ -113,10 +111,9 @@ static void Altivec_test (void)
>>         #endif
>> 
>>         /**
>>         - * Determines the CPU capabilities and stores them in
>cpu_flags.
>>         - * The result can be retrieved with vlc_CPU().
>>         + * Determines the CPU capabilities.
>>         */
>>         -static void vlc_CPU_init(void)
>>         +static unsigned vlc_CPU_raw(void)
>> 
>> 
>>     Should be uint32_t.
>> 
>>         {
>>         uint32_t i_capabilities = 0;
>> 
>>         @@ -247,8 +244,14 @@ out:
>>         # endif
>> 
>>         #endif
>>         + return i_capabilities;
>>         +}
>> 
>>         - cpu_flags = i_capabilities;
>>         +static uint32_t cpu_flags;
>>         +
>>         +static void vlc_CPU_init(void)
>>         +{
>>         + cpu_flags = vlc_CPU_raw();
>>         }
>> 
>>         VLC_WEAK unsigned vlc_CPU(void)
>>         -- 
>>         2.26.0
>>        
>------------------------------------------------------------------------
>>         vlc-devel mailing list
>>         To unsubscribe or modify your subscription options:
>>         https://mailman.videolan.org/listinfo/vlc-devel
>> 
>>    
>------------------------------------------------------------------------
>>     vlc-devel mailing list
>>     To unsubscribe or modify your subscription options:
>>     https://mailman.videolan.org/listinfo/vlc-devel
>> 
>> 
>> -- 
>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
>excuser 
>> ma brièveté.
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>> 
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200330/d2492097/attachment.html>


More information about the vlc-devel mailing list