9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] portability question
@ 2010-06-16  9:11 hugo rivera
  2010-06-16 10:01 ` Lucio De Re
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: hugo rivera @ 2010-06-16  9:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Can someone clarify why the program included outputs 'AB000000' (as I
expect) on 32 bit systems and 'FFFFFFFFAB000000' on 64 bit systems?
where all those 1's came from? what's the portable way of doing this?
sorry for newbie questions like this.


       unsigned long l;
        unsigned char c;

        l = 0L;
        c = 0xAB;
        l |= c << 24;
        printf("%lX\n", l);


--
Hugo



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-17  7:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-16  9:11 [9fans] portability question hugo rivera
2010-06-16 10:01 ` Lucio De Re
2010-06-16 10:15   ` hugo rivera
2010-06-16 10:27   ` Charles Forsyth
2010-06-16 13:30 ` maht
2010-06-16 15:26   ` erik quanstrom
2010-06-16 17:52 ` Bakul Shah
2010-06-17  7:50   ` hugo rivera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).