aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2019-12-03 16:51:29 -0800
committerGerald Combs <gerald@wireshark.org>2019-12-04 19:31:39 +0000
commitf2c2b9687d4dbcb8cd83e84c8f073b4285bb7f72 (patch)
tree5a4b43b41f9a830397f4bae4b72bc79c839651ce /doc
parent9879850cc36cac3d3352ef87a6759c50e0c29c18 (diff)
README.dissector: Add a note about integer promotion.
Change-Id: Ie3b6dfcea7b1cee3b0bda3d9ec2cc9a6857578fc Reviewed-on: https://code.wireshark.org/review/35308 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/README.dissector7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/README.dissector b/doc/README.dissector
index 16bbba6cde..a35089728c 100644
--- a/doc/README.dissector
+++ b/doc/README.dissector
@@ -329,6 +329,13 @@ gint64 tvb_get_letohi56(tvbuff_t *tvb, const gint offset);
guint64 tvb_get_letoh64(tvbuff_t *tvb, const gint offset);
gint64 tvb_get_letohi64(tvbuff_t *tvb, const gint offset);
+NOTE: Although each of the integer accessors above return types with
+specific sizes, the returned values are subject to C's integer promotion
+rules. It's often safer and more useful to use int or guint for 32-bit
+and smaller types, and gint64 or guint64 for 40-bit and larger types.
+Just because a value occupied 16 bits on the wire or over the air
+doesn't mean it will within Wireshark.
+
Single-precision and double-precision IEEE floating-point numbers:
gfloat tvb_get_letohieee_float(tvbuff_t *tvb, const gint offset);