Remind people not to use "g_ntoh[ls]()" or "g_hton[ls]()" to convert
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Mar 2005 02:39:21 +0000 (02:39 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Mar 2005 02:39:21 +0000 (02:39 +0000)
big-endian to little-endian - that doesn't work on big-endian machines.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13874 f5534014-38df-0310-8fa8-9805f1628bb7

doc/README.developer

index 74baee5e5262864718517f720f43f8c727b3ed3a..cea3bc87e1213a7bb2b750989d154725385f8736 100644 (file)
@@ -149,6 +149,14 @@ those are declared by <glib.h>, and you'll need to include that anyway,
 as Ethereal header files that all dissectors must include use stuff from
 <glib.h>.
 
+Don't fetch a little-endian value using "tvb_get_ntohs() or
+"tvb_get_ntohl()" and then using "g_ntohs()", "g_htons()", "g_ntohl()",
+or "g_htonl()" on the resulting value - the g_ routines in question
+convert between network byte order (big-endian) and *host* byte order,
+not *little-endian* byte order; not all machines on which Ethereal runs
+are little-endian, even though PC's are.  Fetch those values using
+"tvb_get_letohs()" and "tvb_get_letohl()".
+
 Don't put a comma after the last element of an enum - some compilers may
 either warn about it (producing extra noise) or refuse to accept it.