[PATCH] aesthetic endian-related patch

Bernhard Fischer rep.nop at aon.at
Mon Apr 3 14:36:24 UTC 2006


On Mon, Mar 06, 2006 at 05:43:10PM -0500, Rob Landley wrote:
>On Saturday 04 March 2006 11:26 am, Robert P. J. Day wrote:
>>   a first attempt.
>
>> -#else
>> -#define __swap16(x) (x)
>> -#define __swap32(x) (x)
>> -#endif
>> +#else /* it's little-endian */
>> +# define __swap16(x) (x)
>> +# define __swap32(x) (x)
>> +#endif /* BB_BIG_ENDIAN */
>
>I dislike indenting preprocessor macros.  If the topic comes up, it generally 
>means there are too many preprocessor macros, and putting the space after the 
># instead of before it disturbs me because I mentally consider #ifdef to be a 
>token.
>
>But I realize there are others who disagree with me on this aesthetic...
>
>However, switching over to the BB_ macros for endianness is something we need 
>to do anyway, so...
>
>Applied.
>
>Rob
>
>(Why is this sitting around on my desktop rather than sent already?)

Looks like this patch is incomplete?

e2fsprogs/blkid/probe.h:#if  __BYTE_ORDER == __BIG_ENDIAN
e2fsprogs/e2fsbb.h:#if __BYTE_ORDER == __BIG_ENDIAN
e2fsprogs/ext2fs/ext2fs.h:#if defined(ENABLE_SWAPFS) ||
defined(WORDS_BIGENDIAN) || __BYTE_ORDER== __BIG_ENDIAN
include/platform.h:#ifdef __BIG_ENDIAN__
include/platform.h:#elif __BYTE_ORDER == __BIG_ENDIAN
libbb/sha1.c:#endif /* __BYTE_ORDER */
miscutils/hdparm.c:#if __BYTE_ORDER == __BIG_ENDIAN
miscutils/hdparm.c:#if __BYTE_ORDER == __BIG_ENDIAN
networking/udhcp/options.c:                     if (__BYTE_ORDER ==
__BIG_ENDIAN)

The occurances in platform.h are obviously ok, but the rest isn't.
Does someone care to fix this?

TIA,

>-- 
>Never bet against the cheap plastic solution.
>_______________________________________________
>busybox mailing list
>busybox at busybox.net
>http://busybox.net/cgi-bin/mailman/listinfo/busybox
>



More information about the busybox mailing list