diff options
author | Gerald Combs <gerald@wireshark.org> | 2011-07-11 20:32:19 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2011-07-11 20:32:19 +0000 |
commit | 49b92440deaabb43114479e5b0e6af2c481ca8ac (patch) | |
tree | 011c39768a3be7d7d1f63d9d48d1b6e96383fdf0 /epan/ftypes | |
parent | 1f923105f8a5c2c7bf82f1187984600ba14ef993 (diff) |
More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.
svn path=/trunk/; revision=37978
Diffstat (limited to 'epan/ftypes')
-rw-r--r-- | epan/ftypes/ftype-bytes.c | 10 | ||||
-rw-r--r-- | epan/ftypes/ftype-pcre.c | 52 | ||||
-rw-r--r-- | epan/ftypes/ftype-string.c | 10 | ||||
-rw-r--r-- | epan/ftypes/ftype-tvbuff.c | 18 | ||||
-rw-r--r-- | epan/ftypes/ftypes-int.h | 2 | ||||
-rw-r--r-- | epan/ftypes/ftypes.h | 4 |
6 files changed, 18 insertions, 78 deletions
diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c index c73c21501e..95094810cd 100644 --- a/epan/ftypes/ftype-bytes.c +++ b/epan/ftypes/ftype-bytes.c @@ -32,14 +32,10 @@ #include <epan/strutil.h> #include <epan/oids.h> -#if defined(HAVE_LIBPCRE) || GLIB_CHECK_VERSION(2,14,0) -# ifdef HAVE_LIBPCRE +#ifdef HAVE_LIBPCRE # include <pcre.h> -# endif -#define CMP_MATCHES cmp_matches -#else -#define CMP_MATCHES NULL #endif +#define CMP_MATCHES cmp_matches static void bytes_fvalue_new(fvalue_t *fv) @@ -506,7 +502,7 @@ cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) } return FALSE; } -#elif GLIB_CHECK_VERSION(2,14,0) /* GRegex */ +#else /* GRegex */ static gboolean cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) { diff --git a/epan/ftypes/ftype-pcre.c b/epan/ftypes/ftype-pcre.c index 4201dc75c4..c94f541d26 100644 --- a/epan/ftypes/ftype-pcre.c +++ b/epan/ftypes/ftype-pcre.c @@ -39,7 +39,7 @@ #include <pcre.h> -/* Create a pcre_tuple_t object based on the given string pattern */ +/* Create a pcre_tuple_t object based on the given string pattern */ static pcre_tuple_t * pcre_tuple_new(const char *value) { @@ -216,7 +216,7 @@ ftype_register_pcre(void) ftype_register(FT_PCRE, &pcre_type); } -#elif GLIB_CHECK_VERSION(2,14,0) /* No HAVE_LIBPCRE. Try falling back to GRegex. */ +#else /* No HAVE_LIBPCRE. Try falling back to GRegex. */ #include <glib.h> @@ -351,53 +351,8 @@ ftype_register_pcre(void) ftype_register(FT_PCRE, &pcre_type); } -#else /* No HAVE_LIBPCRE or GRegex */ - -void -ftype_register_pcre(void) -{ - static ftype_t pcre_type = { - FT_PCRE, /* ftype */ - "FT_PCRE", /* name */ - "Compiled Perl-Compatible Regular Expression object", /* pretty_name */ - 0, /* wire_size */ - NULL, /* new_value */ - NULL, /* free_value */ - NULL, /* val_from_unparsed */ - NULL, /* val_from_string */ - NULL, /* val_to_string_repr */ - NULL, /* len_string_repr */ - - NULL, /* set_value */ - NULL, /* set_value_uinteger */ - NULL, /* set_value_sinteger */ - NULL, /* set_value_integer64 */ - NULL, /* set_value_floating */ - - NULL, /* get_value */ - NULL, /* get_value_uinteger */ - NULL, /* get_value_sinteger */ - NULL, /* get_value_integer64 */ - NULL, /* get_value_floating */ - - NULL, /* cmp_eq */ - NULL, /* cmp_ne */ - NULL, /* cmp_gt */ - NULL, /* cmp_ge */ - NULL, /* cmp_lt */ - NULL, /* cmp_le */ - NULL, /* cmp_bitwise_and */ - NULL, /* cmp_contains */ - NULL, /* cmp_matches */ - - NULL, /* len */ - NULL, /* slice */ - }; - ftype_register(FT_PCRE, &pcre_type); -} - #endif /* HAVE_LIBPCRE */ - + /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * @@ -410,4 +365,3 @@ ftype_register_pcre(void) * vi: set shiftwidth=4 tabstop=4 noexpandtab * :indentSize=4:tabSize=4:noTabs=false: */ - diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index 11ccdf38a7..24ec502d9d 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -28,14 +28,10 @@ #include <ftypes-int.h> #include <string.h> -#if defined(HAVE_LIBPCRE) || GLIB_CHECK_VERSION(2,14,0) -# ifdef HAVE_LIBPCRE +#ifdef HAVE_LIBPCRE # include <pcre.h> -# endif -#define CMP_MATCHES cmp_matches -#else -#define CMP_MATCHES NULL #endif +#define CMP_MATCHES cmp_matches #include <ctype.h> @@ -288,7 +284,7 @@ cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) } return FALSE; } -#elif GLIB_CHECK_VERSION(2,14,0) /* GRegex */ +#else /* GRegex */ static gboolean cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) { diff --git a/epan/ftypes/ftype-tvbuff.c b/epan/ftypes/ftype-tvbuff.c index 2b1b44373f..f87c88eed5 100644 --- a/epan/ftypes/ftype-tvbuff.c +++ b/epan/ftypes/ftype-tvbuff.c @@ -28,14 +28,10 @@ #include <ftypes-int.h> #include <string.h> -#if defined(HAVE_LIBPCRE) || GLIB_CHECK_VERSION(2,14,0) -# ifdef HAVE_LIBPCRE +#ifdef HAVE_LIBPCRE # include <pcre.h> -# endif -#define CMP_MATCHES cmp_matches -#else -#define CMP_MATCHES NULL #endif +#define CMP_MATCHES cmp_matches #define tvb_is_private fvalue_gboolean1 @@ -253,7 +249,7 @@ cmp_ne(fvalue_t *fv_a, fvalue_t *fv_b) TRY { guint a_len = tvb_length(a); - + if (a_len != tvb_length(b)) { return TRUE; } @@ -277,7 +273,7 @@ cmp_gt(fvalue_t *fv_a, fvalue_t *fv_b) TRY { guint a_len = tvb_length(a); guint b_len = tvb_length(b); - + if (a_len > b_len) { return TRUE; } @@ -301,7 +297,7 @@ cmp_ge(fvalue_t *fv_a, fvalue_t *fv_b) { tvbuff_t *a = fv_a->value.tvb; tvbuff_t *b = fv_b->value.tvb; - + TRY { guint a_len = tvb_length(a); guint b_len = tvb_length(b); @@ -333,7 +329,7 @@ cmp_lt(fvalue_t *fv_a, fvalue_t *fv_b) TRY { guint a_len = tvb_length(a); guint b_len = tvb_length(b); - + if (a_len < b_len) { return TRUE; } @@ -444,7 +440,7 @@ cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) } return FALSE; } -#elif GLIB_CHECK_VERSION(2,14,0) /* GRegex */ +#else /* GRegex */ static gboolean cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b) { diff --git a/epan/ftypes/ftypes-int.h b/epan/ftypes/ftypes-int.h index e84cd42d83..0e8154e400 100644 --- a/epan/ftypes/ftypes-int.h +++ b/epan/ftypes/ftypes-int.h @@ -38,8 +38,6 @@ struct _pcre_tuple_t { pcre_extra *ex; char *error; }; -#elif GLIB_CHECK_VERSION(2,14,0) /* No HAVE_LIBPCRE. Try falling back to GRegex. */ - #endif /* HAVE_LIBPCRE */ void diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h index f4ea1ea5bc..dd95df2720 100644 --- a/epan/ftypes/ftypes.h +++ b/epan/ftypes/ftypes.h @@ -62,7 +62,7 @@ enum ftenum { FT_PCRE, /* a compiled Perl-Compatible Regular Expression object */ FT_GUID, /* GUID, UUID */ FT_OID, /* OBJECT IDENTIFIER */ - FT_EUI64, + FT_EUI64, FT_NUM_TYPES /* last item number plus one */ }; @@ -170,7 +170,7 @@ typedef struct _fvalue_t { tvbuff_t *tvb; #ifdef HAVE_LIBPCRE pcre_tuple_t *re; -#elif GLIB_CHECK_VERSION(2,14,0) /* Try falling back to GRegex. */ +#else /* Try falling back to GRegex. */ GRegex *re; #endif /* HAVE_LIBPCRE */ } value; |