From kde-devel Thu Oct 28 07:00:31 2004 From: =?ISO-8859-1?Q?Szombathelyi_Gy=F6rgy?= Date: Thu, 28 Oct 2004 07:00:31 +0000 To: kde-devel Subject: Re: Byte order conversions Message-Id: <4180990F.50108 () freemail ! hu> X-MARC-Message: https://marc.info/?l=kde-devel&m=109894688129471 Hello! Richard Smith wrote: > > My 2¢: > > The KBE2ME_nn macros and the like could just as well be inline functions. > That'd be better for debugging; you'd be able to call them from gdb, and step > into them. I personally would prefer more readable/obvious function/macro > names. > I hope these functions doesn't need any debugging. In contrast I don't want names like KBigEndianToMachineEndian. Personal taste, I think. Actually I took the function names from MPlayer's own bswap.h and prefixed them with 'K'. > I think the KSWAP_nn functions would be more readable if they were made less > compact; there's nothing wrong with having a brace on a line of its own > (personal preference of course, YMMV). I'm ok with this. Again (but less important this time) > I'd prefer more verbose names. And making them static will result in huge > bloat if the compiler decides to make out-of-line copies (eg for debugging > purposes). > These functions are so small, is that really matters? > And a templated machineToBigEndian(...), bigToMachineEndian(...), etc > would be nice too (so the caller doesn't have to care how wide an int is, for > instance). The places where these functions are used are very sensitive to the length of the actual data, so one should always know its size, I think. Thanks for the comments! Bye, György >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<