diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-14 15:38:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-14 15:38:37 +0000 |
commit | 7c075be5f2a92066fb866dff76bb8b0e2cabcbc5 (patch) | |
tree | 77898263f333175ed19a1665bdf8d1fcea8962cf | |
parent | e92a1feab0fc5c657013836fa6f479374967949e (diff) | |
download | gnunet-7c075be5f2a92066fb866dff76bb8b0e2cabcbc5.tar.gz gnunet-7c075be5f2a92066fb866dff76bb8b0e2cabcbc5.zip |
-removing useless casts
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 1ff04f5ad..85cdf8252 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -1113,7 +1113,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
1113 | */ | 1113 | */ |
1114 | void | 1114 | void |
1115 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | 1115 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, |
1116 | const struct GNUNET_HashCode * key, | 1116 | const struct GNUNET_HashCode *key, |
1117 | unsigned int get_path_length, | 1117 | unsigned int get_path_length, |
1118 | const struct GNUNET_PeerIdentity *get_path, | 1118 | const struct GNUNET_PeerIdentity *get_path, |
1119 | unsigned int put_path_length, | 1119 | unsigned int put_path_length, |
@@ -1144,8 +1144,7 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
1144 | _("Could not pass reply to client, message too big!\n")); | 1144 | _("Could not pass reply to client, message too big!\n")); |
1145 | return; | 1145 | return; |
1146 | } | 1146 | } |
1147 | pm = (struct PendingMessage *) GNUNET_malloc (msize + | 1147 | pm = GNUNET_malloc (msize + sizeof (struct PendingMessage)); |
1148 | sizeof (struct PendingMessage)); | ||
1149 | reply = (struct GNUNET_DHT_ClientResultMessage *) &pm[1]; | 1148 | reply = (struct GNUNET_DHT_ClientResultMessage *) &pm[1]; |
1150 | pm->msg = &reply->header; | 1149 | pm->msg = &reply->header; |
1151 | reply->header.size = htons ((uint16_t) msize); | 1150 | reply->header.size = htons ((uint16_t) msize); |
@@ -1231,7 +1230,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1231 | msize = path_length * sizeof (struct GNUNET_PeerIdentity); | 1230 | msize = path_length * sizeof (struct GNUNET_PeerIdentity); |
1232 | msize += sizeof (struct GNUNET_DHT_MonitorGetMessage); | 1231 | msize += sizeof (struct GNUNET_DHT_MonitorGetMessage); |
1233 | msize += sizeof (struct PendingMessage); | 1232 | msize += sizeof (struct PendingMessage); |
1234 | pm = (struct PendingMessage *) GNUNET_malloc (msize); | 1233 | pm = GNUNET_malloc (msize); |
1235 | mmsg = (struct GNUNET_DHT_MonitorGetMessage *) &pm[1]; | 1234 | mmsg = (struct GNUNET_DHT_MonitorGetMessage *) &pm[1]; |
1236 | pm->msg = &mmsg->header; | 1235 | pm->msg = &mmsg->header; |
1237 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); | 1236 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); |
@@ -1309,7 +1308,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1309 | * sizeof (struct GNUNET_PeerIdentity); | 1308 | * sizeof (struct GNUNET_PeerIdentity); |
1310 | msize += sizeof (struct GNUNET_DHT_MonitorGetRespMessage); | 1309 | msize += sizeof (struct GNUNET_DHT_MonitorGetRespMessage); |
1311 | msize += sizeof (struct PendingMessage); | 1310 | msize += sizeof (struct PendingMessage); |
1312 | pm = (struct PendingMessage *) GNUNET_malloc (msize); | 1311 | pm = GNUNET_malloc (msize); |
1313 | mmsg = (struct GNUNET_DHT_MonitorGetRespMessage *) &pm[1]; | 1312 | mmsg = (struct GNUNET_DHT_MonitorGetRespMessage *) &pm[1]; |
1314 | pm->msg = (struct GNUNET_MessageHeader *) mmsg; | 1313 | pm->msg = (struct GNUNET_MessageHeader *) mmsg; |
1315 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); | 1314 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); |
@@ -1395,7 +1394,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1395 | msize += path_length * sizeof (struct GNUNET_PeerIdentity); | 1394 | msize += path_length * sizeof (struct GNUNET_PeerIdentity); |
1396 | msize += sizeof (struct GNUNET_DHT_MonitorPutMessage); | 1395 | msize += sizeof (struct GNUNET_DHT_MonitorPutMessage); |
1397 | msize += sizeof (struct PendingMessage); | 1396 | msize += sizeof (struct PendingMessage); |
1398 | pm = (struct PendingMessage *) GNUNET_malloc (msize); | 1397 | pm = GNUNET_malloc (msize); |
1399 | mmsg = (struct GNUNET_DHT_MonitorPutMessage *) &pm[1]; | 1398 | mmsg = (struct GNUNET_DHT_MonitorPutMessage *) &pm[1]; |
1400 | pm->msg = (struct GNUNET_MessageHeader *) mmsg; | 1399 | pm->msg = (struct GNUNET_MessageHeader *) mmsg; |
1401 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); | 1400 | mmsg->header.size = htons (msize - sizeof (struct PendingMessage)); |