Don't assign the const pointers passed to hash routines to non-const

pointers.

svn path=/trunk/; revision=12890
This commit is contained in:
Guy Harris 2004-12-31 02:08:01 +00:00
parent f2972f0925
commit caf46302c8
6 changed files with 18 additions and 18 deletions

View File

@ -202,7 +202,7 @@ ata_cmd_equal_matched(gconstpointer k1, gconstpointer k2)
static guint
ata_cmd_hash_unmatched(gconstpointer k)
{
const ata_info_t *key = (ata_info_t *)k;
const ata_info_t *key = k;
return key->tag;
}
@ -210,8 +210,8 @@ ata_cmd_hash_unmatched(gconstpointer k)
static gint
ata_cmd_equal_unmatched(gconstpointer k1, gconstpointer k2)
{
const ata_info_t *key1 = (ata_info_t *)k1;
const ata_info_t *key2 = (ata_info_t *)k2;
const ata_info_t *key1 = k1;
const ata_info_t *key2 = k2;
return (key1->tag==key2->tag)&&(key1->conversation==key2->conversation);
}

View File

@ -166,8 +166,8 @@ static guint32 fc_exchange_init_count = 200;
static gint
fcseq_equal(gconstpointer v, gconstpointer w)
{
fcseq_conv_key_t *v1 = (fcseq_conv_key_t *)v;
fcseq_conv_key_t *v2 = (fcseq_conv_key_t *)w;
const fcseq_conv_key_t *v1 = v;
const fcseq_conv_key_t *v2 = w;
return (v1->conv_idx == v2->conv_idx);
}
@ -175,7 +175,7 @@ fcseq_equal(gconstpointer v, gconstpointer w)
static guint
fcseq_hash (gconstpointer v)
{
fcseq_conv_key_t *key = (fcseq_conv_key_t *)v;
const fcseq_conv_key_t *key = v;
guint val;
val = key->conv_idx;

View File

@ -193,8 +193,8 @@ static dissector_handle_t data_handle, fcsp_handle;
static gint
fcels_equal(gconstpointer v, gconstpointer w)
{
fcels_conv_key_t *v1 = (fcels_conv_key_t *)v;
fcels_conv_key_t *v2 = (fcels_conv_key_t *)w;
const fcels_conv_key_t *v1 = v;
const fcels_conv_key_t *v2 = w;
return (v1->conv_idx == v2->conv_idx);
}
@ -202,7 +202,7 @@ fcels_equal(gconstpointer v, gconstpointer w)
static guint
fcels_hash (gconstpointer v)
{
fcels_conv_key_t *key = (fcels_conv_key_t *)v;
const fcels_conv_key_t *key = v;
guint val;
val = key->conv_idx;

View File

@ -108,8 +108,8 @@ static dissector_handle_t data_handle;
static gint
fcfzs_equal(gconstpointer v, gconstpointer w)
{
fcfzs_conv_key_t *v1 = (fcfzs_conv_key_t *)v;
fcfzs_conv_key_t *v2 = (fcfzs_conv_key_t *)w;
const fcfzs_conv_key_t *v1 = v;
const fcfzs_conv_key_t *v2 = w;
return (v1->conv_idx == v2->conv_idx);
}
@ -117,7 +117,7 @@ fcfzs_equal(gconstpointer v, gconstpointer w)
static guint
fcfzs_hash (gconstpointer v)
{
fcfzs_conv_key_t *key = (fcfzs_conv_key_t *)v;
const fcfzs_conv_key_t *key = v;
guint val;
val = key->conv_idx;

View File

@ -108,8 +108,8 @@ guint32 fcp_init_count = 25;
static gint
fcp_equal(gconstpointer v, gconstpointer w)
{
fcp_conv_key_t *v1 = (fcp_conv_key_t *)v;
fcp_conv_key_t *v2 = (fcp_conv_key_t *)w;
const fcp_conv_key_t *v1 = v;
const fcp_conv_key_t *v2 = w;
return (v1->conv_idx == v2->conv_idx);
}
@ -117,7 +117,7 @@ fcp_equal(gconstpointer v, gconstpointer w)
static guint
fcp_hash (gconstpointer v)
{
fcp_conv_key_t *key = (fcp_conv_key_t *)v;
const fcp_conv_key_t *key = v;
guint val;
val = key->conv_idx;

View File

@ -481,8 +481,8 @@ typedef struct
/* Equal keys */
gint sip_equal(gconstpointer v, gconstpointer v2)
{
const sip_hash_key* val1 = (sip_hash_key*)v;
const sip_hash_key* val2 = (sip_hash_key*)v2;
const sip_hash_key* val1 = v;
const sip_hash_key* val2 = v2;
/* Call id must match */
if (strcmp(val1->call_id, val2->call_id) != 0)
@ -502,7 +502,7 @@ gint sip_equal(gconstpointer v, gconstpointer v2)
guint sip_hash_func(gconstpointer v)
{
gint n;
sip_hash_key *key = (sip_hash_key*)v;
const sip_hash_key *key = v;
guint value = strlen(key->call_id);
gint chars_to_use = value / 4;