diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-03-23 02:39:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-03-23 02:39:21 +0000 |
commit | d4d1206ad5f1bf7374f279addc89e6dc74bd099f (patch) | |
tree | ac5a68d710b82055e807759bf6b1596bf284cc12 /doc | |
parent | 596a4f865b8fff0c679fcd1116b6b2c72b73d23f (diff) | |
download | wireshark-d4d1206ad5f1bf7374f279addc89e6dc74bd099f.tar.gz wireshark-d4d1206ad5f1bf7374f279addc89e6dc74bd099f.tar.bz2 wireshark-d4d1206ad5f1bf7374f279addc89e6dc74bd099f.zip |
Remind people not to use "g_ntoh[ls]()" or "g_hton[ls]()" to convert
big-endian to little-endian - that doesn't work on big-endian machines.
svn path=/trunk/; revision=13874
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.developer | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/README.developer b/doc/README.developer index 74baee5e52..cea3bc87e1 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -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. |