This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: BZ#13926: Add __bswap_64 for non-GCC compilers


> 	[BZ #13926]
> 	* sysdeps/i386/bits/byteswap.h (__bswap_constant_64): Add
> 	definition for non gcc compilers.
> 	(__bswap_64): Add implementation for non gcc compilers.

Write these as:

	[!__GNUC__] (__bswap_constant_64): New macro for this case.
	[!__GNUC__] (__bswap_64): New inline function for this case.

> +#else
> +# define __bswap_constant_64(x) \
> +     ((((x) & 0xff00000000000000ul) >> 56)				      \
> +      | (((x) & 0x00ff000000000000ul) >>  40)				      \

There's an excess space in this line (before 40).
(Same in all the copies.)

> +static __inline unsigned long long int
> +__bswap_64 (unsigned long long int __bsx)

This is consistent with the existing __bswap_16 et al.
But, incidentally all these probably want __attribute__((__unused__))
to avoid warnings.  But since __attribute__ will be defined away in
<sys/cdefs.h> under the conditions where this code would be used,
I guess there is actually nothing that can be done.


With the whitespace and the log entries fixed, I think this is fine.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]