From ff3f10e5a5bd4e193cd860bd7a4d64edae474ec9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 19 Aug 2004 19:44:57 +0000 Subject: [PATCH] Note that "G_GINT64_CONSTANT()" should be used for constant values that don't fit in 32 bits, rather than using "LL" at the end. Clean up some other 64-bit-integer items. svn path=/trunk/; revision=11779 --- doc/README.developer | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/doc/README.developer b/doc/README.developer index db87ed7ce2..c6de0b2ad6 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -55,17 +55,30 @@ long on many platforms. Use "gint32" for signed 32-bit integers and use Don't use "long" to mean "signed 64-bit integer" and don't use "unsigned long" to mean "unsigned 64-bit integer"; "long"s are 32 bits long on -other many platforms. Also don't use "long long" or "unsigned long -long", as not all platforms support them; use "gint64" or "guint64", +other many platforms. Don't use "long long" or "unsigned long long", +either, as not all platforms support them; use "gint64" or "guint64", which will be defined as the appropriate types for 64-bit signed and -unsigned integers. Also, don't assume you can use "%lld", "%llu", -"%llx", or "%llo" to print 64-bit integral data types - not all -platforms support "%ll" for printing them. Instead, use PRId64, PRIu64, -PRIx64, and PRIo64, for example +unsigned integers. + +When printing or displaying the values of 64-bit integral data types, +don't assume use "%lld", "%llu", "%llx", or "%llo" - not all platforms +support "%ll" for printing 64-bit integral data types. Instead, use +PRId64, PRIu64, PRIx64, and PRIo64, for example proto_tree_add_text(tree, tvb, offset, 8, "Sequence Number: %" PRIu64, sequence_number); +When specifying an integral constant that doesn't fit in 32 bits, don't +use "LL" at the end of the constant - not all compilers use "LL" for +that. Instead, put the constant in a call to the "G_GINT64_CONSTANT()" +macro, e.g. + + G_GINT64_CONSTANT(11644473600U) + +rather than + + 11644473600ULL + Don't use a label without a statement following it. For example, something such as