🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2808

Reversing Ints easily in TC++

#2808
From: J. Francis Dries, III
Date: Fri, 26 Oct 1990 04:54
19 lines
1249 bytes
I was hacking up a program to convert Sun Rasterfiles to GIF files when
I ran into a little problem.  Almost all the non-Intel world (or so I'm
told) writes ints MSByte first, whereas Borland's TC++ is
reading/writing ints/longs (I need longs, since I'm working with 32bit
ints from the Sun) LSByte first.

My Question is, is there a way to reverse the order, quickly or cleanly?
I could read in each char at a time and OR it onto the long and SHL all
4 on, but that seems kinda sloppy to me.  I would think that the is a
flag that can be set, or at least a built in macro...

Any ideas?

---
J. Francis Dries, III
...!rutgers!faatcrl!doppler!jdries           jdries%doppler@faatcrl

"You can put a bullet in my head, but you can't kill a word I said"
                                                    -- Mike Muir
Technical Details
Message-ID: <i6TmR3w163w@doppler>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!nih-csl!lhc!ncifcrf!haven!aplcen!samsung!cs.utexas.edu!sun-barr!rutgers!faatcrl!doppler!jdries

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!nih-csl!lhc!ncifcrf!haven!aplcen!samsung!cs.utexas.edu!sun-barr!rutgers!faatcrl!doppler!jdries
From: jdries%doppler@faatcrl (J. Francis Dries, III)
Newsgroups: comp.os.msdos.programmer
Subject: Reversing Ints easily in TC++
Keywords: Int, Intel, Motorola
Message-ID: <i6TmR3w163w@doppler>
Date: 26 Oct 90 04:54:29 GMT
Organization: Only Posers Wear Black Productions
Lines: 19