To compute the difference between two addresses, cast the pointers
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Sep 2008 18:27:33 +0000 (18:27 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Sep 2008 18:27:33 +0000 (18:27 +0000)
commit467c214f2fd54bb2d87ab54b4aecabd3fa7ebd83
tree908431d65b2c8edeb1a3c73d22a825335197606c
parentae9846cfb9a25f605e49e87a2b8cbf1d195f578a
To compute the difference between two addresses, cast the pointers
holding those addresses to "void *" and then to "char *" (so we don't
get warnings from casting directly to "char *" or errors from
subtracting two "void *"s), and subtract them, rather than casting the
pointers to an integral type possibly shorter than the pointers (to
avoid warnings and to avoid the admittedly-infinitesimal chance that the
two pointers don't differ in the bits that fit into the integral type).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26151 f5534014-38df-0310-8fa8-9805f1628bb7
plugins/mate/mate_util.c