[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Byte order conversions
From: Szombathelyi_György <gyurco () freemail ! hu>
Date: 2004-10-28 7:00:31
Message-ID: 4180990F.50108 () freemail ! hu
[Download RAW message or body]
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<T>(...), bigToMachineEndian<T>(...), 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 <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic