Message-Id: <199605160145.LAA17047@tornado.netspace.net.au> Subject: Re: 64-bit integers Date: Thu, 16 May 96 11:50:51 +1000 From: Adam Hinkley To: "Eli Zaretskii" cc: , , Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" >The old v1.x library sources archive (djlsr112.zip) included the sources >for these functions; if you can get that, you won't need to download the >multi-megabyte gcc distribution. This source is for a big endian right? I don't have the definition for DItype, but the PowerPC is a little endian, which means I have defined it as: typedef struct { long high; // little endian unsigned long low; } DItype; Would I be correct in saying the big endian version would make "low" signed instead of "high"? So, am I correct in assuming that if djlsr112 typecasts low to unsigned, I should do the opposite? For example, if this is for big endians.... if (au.s.high < bu.s.high) return -1; else if (au.s.high > bu.s.high) return 1; if ((unsigned long) au.s.low < (unsigned long)bu.s.low) return -1; else if ((unsigned long) au.s.low > (unsigned long)bu.s.low) return 1; ...then to make it work on little endians, I should change it to... if ((unsigned long)au.s.high < (unsigned long)bu.s.high) return -1; else if ((unsigned long)au.s.high > (unsigned long)bu.s.high) return 1; if (au.s.low < bu.s.low) return -1; else if (au.s.low > bu.s.low) return 1; Correct? Thanks Adam