[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Byte order conversions
From:       Rüdiger_Knörig <ruediger () knoerig ! de>
Date:       2004-10-27 13:05:18
Message-ID: 200410271505.18766.ruediger () knoerig ! de
[Download RAW message or body]

Am Mittwoch, 27. Oktober 2004 15:17 schrieb Szombathelyi György:
> Rüdiger Knörig wrote:
>   > The attachment contains a template class which will do the job. For
>
> automatic
>
> > conversion of custom datatypes the autoconf macros AC_C_BIGENDIAN(),
> > AC_CHECK_SIZE(short) and AC_CHECK_SIZE(int) have to be executed.
> > If these macros exist you can convert from host endianess via:
> > ConvertEndianess<double>::convert(doubleval,Endian::BigEndian);
> > or change the endianess via
> > ConvertEndianess<double>::swapEndianess(doubleval);
>
> Isn't it over-engineered a bit? I mean that if some code needs byte
> order conversion, it usually does it in a loop, so some simple macro or
> inline fuction would be faster.
It results in an inline method call and should be very fast since it uses 
different algorithm depending on the size of the input. BTW: are there any 
x86 machine instructions for endianess conversion?
>
> Bye,
> György
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic