From kde-devel Wed Oct 27 13:03:17 2004 From: =?iso-8859-2?q?R=FCdiger_Kn=F6rig?= Date: Wed, 27 Oct 2004 13:03:17 +0000 To: kde-devel Subject: Re: Byte order conversions Message-Id: <200410271503.17563.ruediger () knoerig ! de> X-MARC-Message: https://marc.info/?l=kde-devel&m=109888394230913 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::convert(doubleval,Endian::BigEndian); > > or change the endianess via > > ConvertEndianess::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. Its as fast as a macro but has a clean OO interface. Especially convertEndianess() keeps the code readable. > > 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 <<