From: peter.senna@gmail.com (Peter Senna Tschudin)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to figure out the byteorder only with one byte number?
Date: Sat, 18 Feb 2012 13:59:11 -0200 [thread overview]
Message-ID: <CA+MoWDqwvmNFtXW3aBgO2HwtnOup5TLxeBQVwJOZZs8zDyH=Yw@mail.gmail.com> (raw)
In-Reply-To: <CAOe6JY0RS9G+MdrGXeTgaTQk=MSOety-EWiubsW9faLwjaxZnw@mail.gmail.com>
I found:
http://stackoverflow.com/questions/2100331/c-macro-definition-to-determine-big-endian-or-little-endian-machine
On Sat, Feb 18, 2012 at 12:33 PM, Tao Jiang <jiangtao.jit@gmail.com> wrote:
> Hi:
>
> As far as I know, we can use an integer 0x12345678 with four bytes
> and bytes[4] array to figure out a machine's byteorder
>
> Is there a method use only one byte 0x01
> and some shifts do the same work?
>
> Thank you.
>
> ---------------
> jiangtao
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
Peter Senna Tschudin
peter.senna at gmail.com
gpg id: 48274C36
next prev parent reply other threads:[~2012-02-18 15:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-18 14:33 How to figure out the byteorder only with one byte number? Tao Jiang
2012-02-18 15:59 ` Peter Senna Tschudin [this message]
2012-02-19 12:08 ` Tao Jiang
2012-02-19 14:24 ` Bernd Petrovitsch
2012-02-19 17:19 ` Graeme Russ
2012-02-20 11:25 ` Tao Jiang
2012-02-20 13:53 ` Subramaniam Appadodharana
2012-02-20 22:32 ` THAI NGUYEN
2012-02-21 1:22 ` Sri Ram Vemulpali
2012-02-21 12:30 ` Tao Jiang
2012-02-21 12:48 ` Bernd Petrovitsch
2012-02-22 11:27 ` Tao Jiang
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='CA+MoWDqwvmNFtXW3aBgO2HwtnOup5TLxeBQVwJOZZs8zDyH=Yw@mail.gmail.com' \
--to=peter.senna@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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).