9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: hugo rivera <uair00@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] portability question
Date: Wed, 16 Jun 2010 11:11:09 +0200	[thread overview]
Message-ID: <AANLkTinYjxYQEDBK5u2kohjRwdZA-wIB9hK8nVVnITuV@mail.gmail.com> (raw)

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



             reply	other threads:[~2010-06-16  9:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16  9:11 hugo rivera [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinYjxYQEDBK5u2kohjRwdZA-wIB9hK8nVVnITuV@mail.gmail.com \
    --to=uair00@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).