htonl, htons, ntohl and ntohs types

Eric Blake ebb9@byu.net
Sat Apr 22 12:49:00 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Samuel Thibault on 4/21/2006 6:17 AM:
>>
>> The Xint32_t typedef's uses long instead of int:
> 
> That's on purpose: on windows, ints are 16bits.

Maybe in Microsoft, but this is the cygwin list, and in cygwin, ints are
32 bits.  And until someone ports cygwin to a 64-bit version of Windows,
longs are also 32 bits.  Using uint32_t isolates you from whatever size
the underlying int or long are while guaranteeing 32-bit semantics; and
your code is buggy if it depends on the underlying type of uint32_t.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFESiSp84KuGfSFAYARAnaKAKCLNxPheRrq/wNI1t1zgC+11G0svQCgpWVQ
J1GqALOnATNqSDzU3qxrSog=
=Qb1n
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list