Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2012 18:51:11 +1000
From:      Peter Jeremy <peter@rulingia.com>
To:        Daniel Grech <dgre090@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Unsigned Integer Encoding
Message-ID:  <20120815085111.GA38845@server.rulingia.com>
In-Reply-To: <CAG167sY3-i_MimZGJ7qv9NC-u6e2w6RWq_fZt3amFn3%2BjdeKbQ@mail.gmail.com>
References:  <CAG167sY3-i_MimZGJ7qv9NC-u6e2w6RWq_fZt3amFn3%2BjdeKbQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2012-Aug-15 10:33:46 +0200, Daniel Grech <dgre090@gmail.com> wrote:
>Hi,
>
>I have what is probably a really elementary question but I can't seem to
>figure it out. In the following snippet of code, why is it that a and b do
>not have the same value in the end ?  :

See http://en.wikipedia.org/wiki/Endian

>Im asking this as I am currently encoding a protocol in which i receive
>data as a sequence of bytes. Casting for example 4 bytes from this stream
>leaves me with the situation in variable b, while the situation I am
>looking to accomplish is the one in A (i.e. the bytes are not encoded in
>reverse form).

I suggest you look at xdr(3) and rpcgen(1)

--=20
Peter Jeremy

--wac7ysb48OaltWcw
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlArYv8ACgkQ/opHv/APuIfSJwCgwkK8lQlomZ5u2E/IHZH7Wx3l
vzgAnjVYVgdBMKwdeUXP7WX5TP3x6xqR
=TQhf
-----END PGP SIGNATURE-----

--wac7ysb48OaltWcw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120815085111.GA38845>