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

List:       kde-devel
Subject:    Re: Byte order conversions
From:       Jeroen Wijnhout <Jeroen.Wijnhout () kdemail ! net>
Date:       2004-10-27 13:26:51
Message-ID: 200410271526.51922.Jeroen.Wijnhout () kdemail ! net
[Download RAW message or body]

On Wednesday 27 October 2004 15:18, Szombathelyi György wrote:
> Thiago Macieira wrote:
> > Szombathelyi György wrote:
> >>Is there anyone who knows convenient byte-order conversion functions in
> >>QT/kdelibs? If not, then what about adding some functions like
> >>{be2me,le2me,me2be,me2le}_{16,32,64) (prefixed with the usual 'K')?. As
> >>I browse through the code, every piece of code which requires this
> >>functionality implements its own solution, usually with ugly macros and
> >>#ifdef WORDS_BIGENDIAN conditionals.
> >
> > htons, htonl, ntohs, ntohl should do the big-endian to machine-endian
> > stuff.
>
> Then why these functions are not used? Is there any portabiliy issues?

AFAIK (but that is not much), these functions are portable to go back and 
forth between the machine order and the network order. The point being that 
the machine order is not the same on all platforms. Hence these functions are 
not portable if you always want to go from big-endian to machine-endian.

best,
Jeroen
-- 
Kile - KDE Integrated LaTeX Editor
http://kile.sourceforge.net
 
>> 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