Remove obsolete GLIB_CHECK_VERSION(2,10,0) checks

svn path=/trunk/; revision=40490
This commit is contained in:
Jörg Mayer 2012-01-14 03:21:28 +00:00
parent 5d542b79d5
commit 71520b8759
2 changed files with 1 additions and 72 deletions

View File

@ -260,14 +260,7 @@ struct _protocol {
/* List of all protocols */
static GList *protocols = NULL;
#define INITIAL_NUM_PROTOCOL_HFINFO 1500
/* Contains information about protocols and header fields. Used when
* dissectors register their data */
#if GLIB_CHECK_VERSION(2,10,0)
#else
static GMemChunk *gmc_hfinfo = NULL;
#endif
#define INITIAL_NUM_PROTOCOL_HFINFO 1500
/* Contains information about a field when a dissector calls
* proto_tree_add_item. */
@ -365,14 +358,6 @@ proto_init(void (register_all_protocols_func)(register_cb cb, gpointer client_da
proto_short_names = g_hash_table_new(wrs_str_hash, g_str_equal);
proto_filter_names = g_hash_table_new(wrs_str_hash, g_str_equal);
#if GLIB_CHECK_VERSION(2,10,0)
#else
gmc_hfinfo = g_mem_chunk_new("gmc_hfinfo",
sizeof(header_field_info),
INITIAL_NUM_PROTOCOL_HFINFO * sizeof(header_field_info),
G_ALLOC_ONLY);
#endif
gpa_hfinfo.len=0;
gpa_hfinfo.allocated_len=0;
gpa_hfinfo.hfi=NULL;
@ -450,12 +435,7 @@ proto_cleanup(void)
PROTO_REGISTRAR_GET_NTH(protocol->proto_id, hfinfo);
DISSECTOR_ASSERT(protocol->proto_id == hfinfo->id);
#if GLIB_CHECK_VERSION(2,10,0)
g_slice_free(header_field_info, hfinfo);
#else
g_mem_chunk_free(gmc_hfinfo, hfinfo);
#endif
g_list_free(protocol->fields);
protocols = g_list_remove(protocols, protocol);
g_free(protocol);
@ -476,14 +456,6 @@ proto_cleanup(void)
proto_filter_names = NULL;
}
#if GLIB_CHECK_VERSION(2,10,0)
#else
if (gmc_hfinfo) {
g_mem_chunk_destroy(gmc_hfinfo);
gmc_hfinfo = NULL;
}
#endif
if(gpa_hfinfo.allocated_len){
gpa_hfinfo.len=0;
gpa_hfinfo.allocated_len=0;
@ -4435,11 +4407,7 @@ proto_register_protocol(const char *name, const char *short_name,
protocols = g_list_prepend(protocols, protocol);
/* Here we do allocate a new header_field_info struct */
#if GLIB_CHECK_VERSION(2,10,0)
hfinfo = g_slice_new(header_field_info);
#else
hfinfo = g_mem_chunk_alloc(gmc_hfinfo);
#endif
hfinfo->name = name;
hfinfo->abbrev = filter_name;
hfinfo->type = FT_PROTOCOL;

View File

@ -408,18 +408,10 @@ fragment_delete(const packet_info *pinfo, const guint32 id, GHashTable *fragment
if( !(fd->flags&FD_NOT_MALLOCED) )
g_free(fd->data);
#if GLIB_CHECK_VERSION(2,10,0)
g_slice_free(fragment_data, fd);
#else
g_mem_chunk_free(fragment_data_chunk, fd);
#endif
fd=tmp_fd;
}
#if GLIB_CHECK_VERSION(2,10,0)
g_slice_free(fragment_data, fd_head);
#else
g_mem_chunk_free(fragment_data_chunk, fd_head);
#endif
g_hash_table_remove(fragment_table, &key);
return data;
@ -586,16 +578,6 @@ fragment_unhash(GHashTable *fragment_table, fragment_key *key)
/*
* Free the key itself.
*/
#if GLIB_CHECK_VERSION(2,10,0)
#else
/*
* Free up the copies of the addresses from the old key.
*/
g_free((gpointer)key->src.data);
g_free((gpointer)key->dst.data);
g_mem_chunk_free(fragment_key_chunk, key);
#endif
}
/*
@ -668,11 +650,7 @@ fragment_add_work(fragment_data *fd_head, tvbuff_t *tvb, const int offset,
unsigned char *old_data;
/* create new fd describing this fragment */
#if GLIB_CHECK_VERSION(2,10,0)
fd = g_slice_new(fragment_data);
#else
fd = g_mem_chunk_alloc(fragment_data_chunk);
#endif
fd->next = NULL;
fd->flags = 0;
fd->frame = pinfo->fd->num;
@ -976,11 +954,7 @@ fragment_add_common(tvbuff_t *tvb, const int offset, const packet_info *pinfo, c
* addresses, allocating new buffers for the address
* data.
*/
#if GLIB_CHECK_VERSION(2,10,0)
new_key = g_slice_new(fragment_key);
#else
new_key = g_mem_chunk_alloc(fragment_key_chunk);
#endif
COPY_ADDRESS(&new_key->src, &key.src);
COPY_ADDRESS(&new_key->dst, &key.dst);
new_key->id = key.id;
@ -1067,11 +1041,7 @@ fragment_add_check(tvbuff_t *tvb, const int offset, const packet_info *pinfo,
* addresses, allocating new buffers for the address
* data.
*/
#if GLIB_CHECK_VERSION(2,10,0)
new_key = g_slice_new(fragment_key);
#else
new_key = g_mem_chunk_alloc(fragment_key_chunk);
#endif
COPY_ADDRESS(&new_key->src, &key.src);
COPY_ADDRESS(&new_key->dst, &key.dst);
new_key->id = key.id;
@ -1233,11 +1203,7 @@ fragment_add_seq_work(fragment_data *fd_head, tvbuff_t *tvb, const int offset,
/* create new fd describing this fragment */
#if GLIB_CHECK_VERSION(2,10,0)
fd = g_slice_new(fragment_data);
#else
fd = g_mem_chunk_alloc(fragment_data_chunk);
#endif
fd->next = NULL;
fd->flags = 0;
fd->frame = pinfo->fd->num;
@ -1753,12 +1719,7 @@ fragment_start_seq_check(const packet_info *pinfo, const guint32 id, GHashTable
if (fd_head == NULL) {
/* Create list-head. */
#if GLIB_CHECK_VERSION(2,10,0)
fd_head = g_slice_new(fragment_data);
#else
fd_head = g_mem_chunk_alloc(fragment_data_chunk);
#endif
fd_head->next = NULL;
fd_head->datalen = tot_len;
fd_head->offset = 0;