diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-08-25 03:44:04 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-08-25 03:44:04 +0000 |
commit | 750812d7391676a8b7fce371978a11f95c6873e7 (patch) | |
tree | 2ad613cd859491e10015fb1a9dc862f34b9068c6 /epan/ftypes/ftype-integer.c | |
parent | 77ed24848995b27f855a17204f6ad24d53a50b18 (diff) |
guint64 & guint64 is another guint64, but a gboolean is just 32 bits on
most if not all platforms; the "bitwise and" operator in display filters
is Boolean and evaluates to "true" if the result is non-zero and "false"
otherwise, so explicitly do the comparison with 0 to make sure we don't
just throw away the upper 32 bits.
Do the same for the 32-bit bitwise AND as well, although it's not
strictly necessary.
svn path=/trunk/; revision=11828
Diffstat (limited to 'epan/ftypes/ftype-integer.c')
-rw-r--r-- | epan/ftypes/ftype-integer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c index 98df3e3ba4..d55c7fbe72 100644 --- a/epan/ftypes/ftype-integer.c +++ b/epan/ftypes/ftype-integer.c @@ -192,7 +192,7 @@ s_cmp_le(fvalue_t *a, fvalue_t *b) static gboolean cmp_bitwise_and(fvalue_t *a, fvalue_t *b) { - return (a->value.integer & b->value.integer); + return ((a->value.integer & b->value.integer) != 0); } static void @@ -321,7 +321,7 @@ s_cmp_le64(fvalue_t *a, fvalue_t *b) static gboolean cmp_bitwise_and64(fvalue_t *a, fvalue_t *b) { - return (a->value.integer64 & b->value.integer64); + return ((a->value.integer64 & b->value.integer64) != 0); } /* BOOLEAN-specific */ |