From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 15 08:51:21 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CD2A106566C for ; Wed, 15 Aug 2012 08:51:21 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 0C01E8FC1B for ; Wed, 15 Aug 2012 08:51:20 +0000 (UTC) Received: from server.rulingia.com (c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7F8pGi0014046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Aug 2012 18:51:17 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7F8pB8P046790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Aug 2012 18:51:11 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7F8pBvi046789; Wed, 15 Aug 2012 18:51:11 +1000 (EST) (envelope-from peter) Date: Wed, 15 Aug 2012 18:51:11 +1000 From: Peter Jeremy To: Daniel Grech Message-ID: <20120815085111.GA38845@server.rulingia.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: Unsigned Integer Encoding X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2012 08:51:21 -0000 --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 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--