Don't assign the const pointers passed to hash routines to non-const
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Dec 2004 02:08:01 +0000 (02:08 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Dec 2004 02:08:01 +0000 (02:08 +0000)
pointers.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12890 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-aoe.c
epan/dissectors/packet-fc.c
epan/dissectors/packet-fcels.c
epan/dissectors/packet-fcfzs.c
epan/dissectors/packet-fcp.c
epan/dissectors/packet-sip.c

index 0a6196a9daebcc47ec3ad3aa6e66037fcb30618c..4efeaac4bba449b77262df5570befda0be8d0d7b 100644 (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);
 }
index fe25f3cc29c3b27bb93ac7ccf66282d1f2bddad4..00d51d8b0ee8880d680fdc144610dbea73850eca 100644 (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;
index a31387038f87c25673f7890cc2bcd243e141a84b..d3c54c296015d2d1e8c82bb5d8e3b1efa2abd99a 100644 (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;
index 6a3154d81f3116138eee432340e88f60768ddd2d..00807a8d7529a03db40f8fa7e1148c06e5f5e36f 100644 (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;
index c87307587f27e3c5cfbe5cea32b740378d0581a3..fb9282b771b9b5671fe4967424779f4bc34cfb3d 100644 (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;
index 8582db1a1cfe1517dbcf11096b79ce82ea4b87f7..6c82ea74b146dc8b50a0eb7916360040c1b5976b 100644 (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;