From owner-cvs-all@FreeBSD.ORG Fri Nov 3 22:30:51 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 498A616A509; Fri, 3 Nov 2006 22:30:51 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id E563043D75; Fri, 3 Nov 2006 22:30:25 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id F074C6086; Sat, 4 Nov 2006 01:30:15 +0300 (MSK) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id CDEAE5C38; Sat, 4 Nov 2006 01:30:15 +0300 (MSK) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id kA3MUGu7055759; Sat, 4 Nov 2006 01:30:16 +0300 (MSK) (envelope-from ru) Date: Sat, 4 Nov 2006 01:30:16 +0300 From: Ruslan Ermilov To: John Baldwin Message-ID: <20061103223016.GA55720@rambler-co.ru> References: <200611031948.kA3JmuZ6072620@repoman.freebsd.org> <454BB06E.40202@cisco.com> <454BB5DC.4030903@cisco.com> <200611031703.29182.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <200611031703.29182.jhb@freebsd.org> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: cvs-src@freebsd.org, Randall Stewart , Doug Barton , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/netinet sctp_asconf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2006 22:30:51 -0000 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 03, 2006 at 05:03:28PM -0500, John Baldwin wrote: > On Friday 03 November 2006 16:34, Randall Stewart wrote: > > /src/sys/netinet/sctp_usrreq.c: In function `sctp_optsset': > > /src/sys/netinet/sctp_usrreq.c:3136: warning: cast from pointer to=20 > > integer of different size > >=20 > >=20 > > The above one I will have to ask if any one of you can give > > me a hand.. I am not a sparcy person ;-) and the line is: > > on_off =3D (mtod(m, int)); > >=20 > > (on_off is declared as a int on_off; a few lines above it). >=20 > mtod() returns a pointer. If you want to get an int out of the > mbuf data, then maybe something like: >=20 > on_off =3D ntohl(*mtod(m, int *))); >=20 > is what you want. As it is, you are casting m->m_data (char *) to an int= and=20 > returning the raw value of the data pointer into your int. :) >=20 This is the setsockopt()/getsockopt() backend, so it looks like no ntohl() is actually necessary. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFS8L3qRfpzJluFF4RAtB6AJ9FQTvo0I10fvTYh5UdOBqubXvRPQCdEo2g Z4ZgZq8d7VhHVa1rcxr7gm4= =mx6f -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--