hipl-core team mailing list archive
-
hipl-core team
-
Mailing list archive
-
Message #00013
[Branch ~hipl-core/hipl/trunk] Rev 4892: Drop pointless void* casts from hip_get_param*() functions.
------------------------------------------------------------
revno: 4892
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-08-18 18:34:37 +0200
message:
Drop pointless void* casts from hip_get_param*() functions.
The functions return void*, so there is no need to cast their return value.
modified:
lib/core/builder.c
lib/core/conf.c
tools/pisacert.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 'lib/core/builder.c'
--- lib/core/builder.c 2010-08-18 15:49:37 +0000
+++ lib/core/builder.c 2010-08-18 16:34:37 +0000
@@ -60,7 +60,7 @@
* <li>struct hip_common *msg = malloc(HIP_MAX_PACKET);</li>
* <li>receive the message from kernel.</li>
* <li>if (msg->err) goto_error_handler;</li>
- * <li>hit = (struct in6addr *) hip_get_param_contents(msg, HIP_PARAM_HIT);</li>
+ * <li>hit = hip_get_param_contents(msg, HIP_PARAM_HIT);</li>
* <li>note: hit can be null, if the param was not found.</li>
* </li>
* <li>note: hit can be null.</li>
=== modified file 'lib/core/conf.c'
--- lib/core/conf.c 2010-08-17 17:23:18 +0000
+++ lib/core/conf.c 2010-08-18 16:34:37 +0000
@@ -271,9 +271,7 @@
param_type = hip_get_param_type(current_param);
if (param_type == HIP_PARAM_HIT_INFO) {
- data = (struct hip_hit_info *)
- hip_get_param_contents_direct(
- current_param);
+ data = hip_get_param_contents_direct(current_param);
inet_ntop(AF_INET6, &data->lhi.hit, hit_s,
INET6_ADDRSTRLEN);
@@ -315,15 +313,11 @@
param_type = hip_get_param_type(current_param);
if (param_type == HIP_PARAM_HIT) {
- defhit = (struct in6_addr *)
- hip_get_param_contents_direct(
- current_param);
+ defhit = hip_get_param_contents_direct(current_param);
inet_ntop(AF_INET6, defhit, hit_s,
INET6_ADDRSTRLEN);
} else if (param_type == HIP_PARAM_LSI) {
- deflsi = (struct in_addr *)
- hip_get_param_contents_direct(
- current_param);
+ deflsi = hip_get_param_contents_direct(current_param);
inet_ntop(AF_INET, deflsi, lsi_s,
INET_ADDRSTRLEN);
} else {
@@ -378,7 +372,7 @@
"Sending msg failed.\n");
while ((param = hip_get_next_param(msg_tmp, param)) != NULL) {
- data = (struct hip_hit_info *) hip_get_param_contents_direct(param);
+ data = hip_get_param_contents_direct(param);
HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_DEL_LOCAL_HI, 0),
-1, "Failed to build user message header\n");
@@ -1767,7 +1761,7 @@
if (param_type == HIP_PARAM_HIT) {
//no need to get the hit from msg
} else if (param_type == HIP_PARAM_INT) {
- diff = (int *) hip_get_param_contents_direct(current_param);
+ diff = hip_get_param_contents_direct(current_param);
} else {
HIP_ERROR("Unrelated parameter in user " \
"message.\n");
=== modified file 'tools/pisacert.c'
--- tools/pisacert.c 2010-07-07 16:03:48 +0000
+++ tools/pisacert.c 2010-08-18 16:34:37 +0000
@@ -64,7 +64,7 @@
HIP_IFE(hip_send_recv_daemon_info(msg, 0, 0), -ECOMM);
param = hip_get_param(msg, HIP_PARAM_HIT);
- hit = (struct in6_addr *) hip_get_param_contents_direct(param);
+ hit = hip_get_param_contents_direct(param);
memcpy(result, hit, sizeof(struct in6_addr));
out_err: