Re: I forgot... Re: Big-endian/little-endian

1998-08-18 Thread Wojciech Zabolotny
On Tue, 18 Aug 1998, Ossama Othman wrote: > Hi again, > > > // "number" is the size of the array being byte swapped > > swap4(void *dest, void *src, int number) { > > I forgot to mention that the code excerpt I posted was meant for swapping > variables that are 4 bytes in size, e.g. fl

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Wojciech Zabolotny
On Tue, 18 Aug 1998, Stephen J. Carpenter wrote: > cool > xfstt is lgpl'd...I dunno about the programs you use > you mind if I use your code in it? Please consider my code to be public domain. Wojtek Zabolotny

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Stephen J. Carpenter
On Tue, Aug 18, 1998 at 02:11:15PM -0400, Lewis, James M. wrote: > I may be speaking out of turn here. nah ;) > I don't know much about X fonts > but they used to be server specific. That was back when the fonts > were .snf files. If you used different versions of the xserver on the > same sy

RE: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Lewis, James M.
Tuesday, August 18, 1998 1:39 PM To: Debian User's List Cc: The recipient's address is unknown. Subject: Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?) On Tue, Aug 18, 1998 at 01:22:53PM -0400, Michael Stone wrote: > Quoting Stephen J.

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Stephen J. Carpenter
On Tue, Aug 18, 1998 at 01:22:53PM -0400, Michael Stone wrote: > Quoting Stephen J. Carpenter ([EMAIL PROTECTED]): > > On Tue, Aug 18, 1998 at 10:34:39AM -0400, Michael Stone wrote: > > > The solution is to always run hton before putting stuff on the wire and > > > running ntoh when pulling stuff b

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Michael Stone
Quoting Stephen J. Carpenter ([EMAIL PROTECTED]): > On Tue, Aug 18, 1998 at 10:34:39AM -0400, Michael Stone wrote: > > The solution is to always run hton before putting stuff on the wire and > > running ntoh when pulling stuff back. That way you can be sure that the > > stuff on the wire is always

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Stephen J. Carpenter
On Tue, Aug 18, 1998 at 10:34:39AM -0400, Michael Stone wrote: > Quoting Stephen J. Carpenter ([EMAIL PROTECTED]): > > The authors concern was that on a big endian system network order and > > byte order are the same so hton* and ntoh* do nothingso how do you > > do the swapps... > > I suggeste

I forgot... Re: Big-endian/little-endian

1998-08-18 Thread Ossama Othman
Hi again, > // "number" is the size of the array being byte swapped > swap4(void *dest, void *src, int number) { I forgot to mention that the code excerpt I posted was meant for swapping variables that are 4 bytes in size, e.g. floats and such. -Ossama

Re: Big-endian/little-endian

1998-08-18 Thread Ossama Othman
Hi, > The authors concern was that on a big endian system network order and > byte order are the same so hton* and ntoh* do nothingso how do you > do the swapps... You could just cast the address of the variable to a "char *" and swap things around using pointer arithmetic or arrays. Here is

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Michael Stone
Quoting Stephen J. Carpenter ([EMAIL PROTECTED]): > The authors concern was that on a big endian system network order and > byte order are the same so hton* and ntoh* do nothingso how do you > do the swapps... > I suggested a union first (like below) but...whats the "proper" way of > doing it?

Re: Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Stephen J. Carpenter
On Tue, Aug 18, 1998 at 02:03:11PM +0200, Wojciech Zabolotny wrote: > Hi! > > Some of my programs have to work on big-endian and little-endian systems, > knowing what kind of system they are runing on (they are exchanging data > in binary format). To recognize the kind of the system I use the foll

Big-endian/little-endian (WAS: Re: can I burn the output of mpg123 -s?)

1998-08-18 Thread Wojciech Zabolotny
Hi! Some of my programs have to work on big-endian and little-endian systems, knowing what kind of system they are runing on (they are exchanging data in binary format). To recognize the kind of the system I use the following routine: int TestByteOrder() { union { unsigned char c[2];