[vlc-devel] [PATCH 1/2] VC compatibility improved a little
Sergey Radionov
rsatom at gmail.com
Wed Sep 19 10:13:30 CEST 2012
2012/9/19 Rémi Denis-Courmont <remi at remlab.net>:
> LLU is a valid integer-suffix according to C99 § 6.4.4.1.
why are you talking about C99 if this part for C++?
#if VLC_GCC_VERSION(4,3)
return __builtin_bswap64 (x);
#elif !defined (__cplusplus)
return ((x & 0x00000000000000FF) << 56)
| ((x & 0x000000000000FF00) << 40)
| ((x & 0x0000000000FF0000) << 24)
| ((x & 0x00000000FF000000) << 8)
| ((x & 0x000000FF00000000) >> 8)
| ((x & 0x0000FF0000000000) >> 24)
| ((x & 0x00FF000000000000) >> 40)
| ((x & 0xFF00000000000000) >> 56);
#else
return ((x & 0x00000000000000FFULL) << 56)
| ((x & 0x000000000000FF00ULL) << 40)
| ((x & 0x0000000000FF0000ULL) << 24)
| ((x & 0x00000000FF000000ULL) << 8)
| ((x & 0x000000FF00000000ULL) >> 8)
| ((x & 0x0000FF0000000000ULL) >> 24)
| ((x & 0x00FF000000000000ULL) >> 40)
| ((x & 0xFF00000000000000ULL) >> 56);
#endif
>
> Patch is wrong.
>
> Le mercredi 19 septembre 2012 10:18:59, Sergey Radionov a écrit :
>> ---
>> include/vlc_common.h | 16 ++++++++--------
>> 1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/vlc_common.h b/include/vlc_common.h
>> index db03b81..631481c 100644
>> --- a/include/vlc_common.h
>> +++ b/include/vlc_common.h
>> @@ -616,14 +616,14 @@ static inline uint64_t bswap64 (uint64_t x)
>>
>> | ((x & 0x00FF000000000000) >> 40)
>> | ((x & 0xFF00000000000000) >> 56);
>>
>> #else
>> - return ((x & 0x00000000000000FFLLU) << 56)
>> - | ((x & 0x000000000000FF00LLU) << 40)
>> - | ((x & 0x0000000000FF0000LLU) << 24)
>> - | ((x & 0x00000000FF000000LLU) << 8)
>> - | ((x & 0x000000FF00000000LLU) >> 8)
>> - | ((x & 0x0000FF0000000000LLU) >> 24)
>> - | ((x & 0x00FF000000000000LLU) >> 40)
>> - | ((x & 0xFF00000000000000LLU) >> 56);
>> + return ((x & 0x00000000000000FFULL) << 56)
>> + | ((x & 0x000000000000FF00ULL) << 40)
>> + | ((x & 0x0000000000FF0000ULL) << 24)
>> + | ((x & 0x00000000FF000000ULL) << 8)
>> + | ((x & 0x000000FF00000000ULL) >> 8)
>> + | ((x & 0x0000FF0000000000ULL) >> 24)
>> + | ((x & 0x00FF000000000000ULL) >> 40)
>> + | ((x & 0xFF00000000000000ULL) >> 56);
>> #endif
>> }
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list