aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-integer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-03 18:14:00 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-03 18:14:00 +0000
commitdfad2b94f5fa40db86bd11e475c310751efafe69 (patch)
tree52e7356882f6648b61bf937b258a6ebcffc54e65 /epan/ftypes/ftype-integer.c
parent4e3b6fb31568d2a767c4f977b8954e124caec30c (diff)
Some UN*Xes don't have any "strtou*" routine to convert a string to a
64-bit integer; use "g_ascii_strtoull()", and, in the configure script, check whether it's available in GLib (it's not in GLib 1.2[.x]) and, if not, supply the GLib 2.4.5 version of the routine. For G_MAXUINT32 and G_MAXUINT64, put a "U" at the end of the constant to explicitly flag it as unsigned. svn path=/trunk/; revision=11889
Diffstat (limited to 'epan/ftypes/ftype-integer.c')
-rw-r--r--epan/ftypes/ftype-integer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c
index d55c7fbe72..e4889ff5ac 100644
--- a/epan/ftypes/ftype-integer.c
+++ b/epan/ftypes/ftype-integer.c
@@ -29,16 +29,20 @@
#include "ftypes-int.h"
#include <epan/addr_resolv.h>
+#ifdef NEED_G_ASCII_STRTOULL_H
+#include "g_ascii_strtoull.h"
+#endif
+
/*
* GLib 1.2[.x] doesn't define G_MAXUINT32 or G_MAXUINT64; if they're
* not defined, we define them as the maximum 32-bit and 32-bit
* unsigned numbers.
*/
#ifndef G_MAXUINT32
-#define G_MAXUINT32 ((guint32)0xFFFFFFFF)
+#define G_MAXUINT32 ((guint32)0xFFFFFFFFU)
#endif
#ifndef G_MAXUINT64
-#define G_MAXUINT64 ((guint64)G_GINT64_CONSTANT(0xFFFFFFFFFFFFFFFF))
+#define G_MAXUINT64 ((guint64)G_GINT64_CONSTANT(0xFFFFFFFFFFFFFFFFU))
#endif
static void
@@ -220,7 +224,7 @@ val64_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, Log
char *endptr;
errno = 0;
- value = strtoull(s, &endptr, 0);
+ value = g_ascii_strtoull(s, &endptr, 0);
if (errno == EINVAL || endptr == s || *endptr != '\0') {
/* This isn't a valid number. */