Date: Sat, 4 Nov 2006 01:30:16 +0300 From: Ruslan Ermilov <ru@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: cvs-src@freebsd.org, Randall Stewart <rrs@cisco.com>, Doug Barton <dougb@freebsd.org>, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/netinet sctp_asconf.c Message-ID: <20061103223016.GA55720@rambler-co.ru> In-Reply-To: <200611031703.29182.jhb@freebsd.org> References: <200611031948.kA3JmuZ6072620@repoman.freebsd.org> <454BB06E.40202@cisco.com> <454BB5DC.4030903@cisco.com> <200611031703.29182.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061103223016.GA55720>