comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: little and big endian -- once more
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: little and big endian -- once more [message #15329] Thu, 13 May 1999 00:00 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi,

Martin Schultz wrote:
>
> Hi all,
>
> took me a while to realize that it is the machine architecture not
> the OS that determines the byte swapping -- in fact I needed to have IDL
> on linux (after using it on an SGI and with Windows) to figure that out
> ... Anyway, I now devised the following test for byte swapping which is
> applied in my open_file routine and handles everything transparently.

I'm not sure if I'm missing some subtlety here, but wouldn't the (newish)
keywords /SWAP_IF_[BIG|LITTLE]_ENDIAN to IDL's OPEN and BYTEORDER routines
work in all cases? I've used them to good effect for cross-platform work.

From the help file:

[...] it only takes effect if the current system has [big|little] endian
byte ordering. This keyword does not refer to the byte ordering of the input
data, but to the computer hardware.

Cheers,
--
-Dick

Dick Jackson Fanning Software Consulting, Canadian Office
djackson@dfanning.com Calgary, Alberta Voice/Fax: (403) 242-7398
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: coherence test implementation
Next Topic: Re: Making an array of structures containing pointers

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 14:20:37 PDT 2025

Total time taken to generate the page: 0.40002 seconds