[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5352: Do not cast variables that have type void*.

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Tue, 04 Jan 2011 12:15:44 -0000

------------------------------------------------------------
revno: 5352
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: hipl
timestamp: Tue 2011-01-04 13:11:37 +0100
message:
  Do not cast variables that have type void*.
  
  In C void* denotes an opaque pointer type and is compatible with any other
  pointer type.  Thus there is no need for casting void* pointers in C.
modified:
  hipd/hadb.c
  lib/core/builder.c


--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk

Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2011-01-04 12:04:26 +0000
+++ hipd/hadb.c 2011-01-04 12:11:37 +0000
@@ -1276,7 +1276,7 @@
 {
     int err                = 0;
     struct hip_hadb_user_info_state hid;
-    struct hip_common *msg = (struct hip_common *) opaq;
+    struct hip_common *msg = opaq;
 
     memset(&hid, 0, sizeof(hid));
     hid.state = entry->state;
@@ -1373,7 +1373,7 @@
 static int hip_hadb_find_lsi(struct hip_hadb_state *entry, void *lsi)
 {
     int exist_lsi;
-    exist_lsi = hip_lsi_are_equal(&entry->lsi_peer, (hip_lsi_t *) lsi);
+    exist_lsi = hip_lsi_are_equal(&entry->lsi_peer, lsi);
     if (exist_lsi) {
         memset(lsi, 0, sizeof(lsi));
     }

=== modified file 'lib/core/builder.c'
--- lib/core/builder.c  2011-01-03 19:36:44 +0000
+++ lib/core/builder.c  2011-01-04 12:11:37 +0000
@@ -1494,7 +1494,7 @@
                                    hip_tlv_len_t param_hdr_size,
                                    const void *contents)
 {
-    const struct hip_tlv_common *param = (const struct hip_tlv_common *) 
parameter_hdr;
+    const struct hip_tlv_common *param = parameter_hdr;
     const void *src                    = NULL;
     uint8_t *dst                       = NULL;
     int err                            = 0, size = 0;
@@ -2243,7 +2243,7 @@
                                      const uint8_t *type_list,
                                      const int type_count)
 {
-    struct hip_reg_request *rreq = (struct hip_reg_request *) param;
+    struct hip_reg_request *rreq = param;
 
     hip_calc_generic_param_len((struct hip_tlv_common *) rreq, sizeof(struct 
hip_reg_request),
                                type_count * sizeof(uint8_t));
@@ -2268,7 +2268,7 @@
 {
     int err    = 0;
     unsigned i = 0;
-    const struct hip_srv *service_list = (const struct hip_srv *) srv_list;
+    const struct hip_srv *service_list = srv_list;
     struct hip_reg_info reg_info;
     uint8_t reg_type[service_count];
 
@@ -3813,8 +3813,8 @@
     char hostname[HIP_HOST_ID_HOSTNAME_LEN_MAX];
     struct hip_host_id_priv *host_id = NULL;
     struct hip_host_id *host_id_pub = NULL;
-    RSA *rsa_key = (RSA *) any_key;
-    DSA *dsa_key = (DSA *) any_key;
+    RSA *rsa_key = any_key;
+    DSA *dsa_key = any_key;
 
     memset(hostname, 0, HIP_HOST_ID_HOSTNAME_LEN_MAX);
     HIP_IFEL(gethostname(hostname, HIP_HOST_ID_HOSTNAME_LEN_MAX - 1), -1,

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5352: Do not cast variables that have type void*. - noreply