@@ -110,10 +110,10 @@ struct DHT {
110110 uint8_t self_public_key [CRYPTO_PUBLIC_KEY_SIZE ];
111111 uint8_t self_secret_key [CRYPTO_SECRET_KEY_SIZE ];
112112
113- DHT_Friend * friends_list ;
113+ DHT_Friend * owner friends_list ;
114114 uint16_t num_friends ;
115115
116- Node_format * loaded_nodes_list ;
116+ Node_format * owner loaded_nodes_list ;
117117 uint32_t loaded_num_nodes ;
118118 unsigned int loaded_nodes_index ;
119119
@@ -370,7 +370,7 @@ int dht_create_packet(const Memory *mem, const Random *rng,
370370 uint8_t * packet , size_t length )
371371{
372372 uint8_t nonce [CRYPTO_NONCE_SIZE ];
373- uint8_t * encrypted = (uint8_t * )mem_balloc (mem , plain_length + CRYPTO_MAC_SIZE );
373+ uint8_t * owner encrypted = (uint8_t * owner )mem_balloc (mem , plain_length + CRYPTO_MAC_SIZE );
374374
375375 if (encrypted == nullptr ) {
376376 return -1 ;
@@ -920,7 +920,7 @@ static void sort_client_list(const Memory *mem, Client_data *list, uint64_t cur_
920920{
921921 // Pass comp_public_key to qsort with each Client_data entry, so the
922922 // comparison function can use it as the base of comparison.
923- DHT_Cmp_Data * cmp_list = (DHT_Cmp_Data * )mem_valloc (mem , length , sizeof (DHT_Cmp_Data ));
923+ DHT_Cmp_Data * owner cmp_list = (DHT_Cmp_Data * owner )mem_valloc (mem , length , sizeof (DHT_Cmp_Data ));
924924
925925 if (cmp_list == nullptr ) {
926926 return ;
@@ -1591,7 +1591,8 @@ int dht_addfriend(DHT *dht, const uint8_t *public_key, dht_ip_cb *ip_callback,
15911591 return 0 ;
15921592 }
15931593
1594- DHT_Friend * const temp = (DHT_Friend * )mem_vrealloc (dht -> mem , dht -> friends_list , dht -> num_friends + 1 , sizeof (DHT_Friend ));
1594+ DHT_Friend * const owner temp =
1595+ (DHT_Friend * owner )mem_vrealloc (dht -> mem , dht -> friends_list , dht -> num_friends + 1 , sizeof (DHT_Friend ));
15951596
15961597 if (temp == nullptr ) {
15971598 return -1 ;
@@ -1641,7 +1642,8 @@ int dht_delfriend(DHT *dht, const uint8_t *public_key, uint32_t lock_token)
16411642 return 0 ;
16421643 }
16431644
1644- DHT_Friend * const temp = (DHT_Friend * )mem_vrealloc (dht -> mem , dht -> friends_list , dht -> num_friends , sizeof (DHT_Friend ));
1645+ DHT_Friend * const owner temp =
1646+ (DHT_Friend * owner )mem_vrealloc (dht -> mem , dht -> friends_list , dht -> num_friends , sizeof (DHT_Friend ));
16451647
16461648 if (temp == nullptr ) {
16471649 return -1 ;
@@ -1694,8 +1696,10 @@ static uint8_t do_ping_and_sendnode_requests(DHT *dht, uint64_t *lastgetnode, co
16941696 const uint64_t temp_time = mono_time_get (dht -> mono_time );
16951697
16961698 uint32_t num_nodes = 0 ;
1697- Client_data * * client_list = (Client_data * * )mem_valloc (dht -> mem , list_count * 2 , sizeof (Client_data * ));
1698- IPPTsPng * * assoc_list = (IPPTsPng * * )mem_valloc (dht -> mem , list_count * 2 , sizeof (IPPTsPng * ));
1699+ Client_data * * owner client_list =
1700+ (Client_data * * owner )mem_valloc (dht -> mem , list_count * 2 , sizeof (Client_data * ));
1701+ IPPTsPng * * owner assoc_list =
1702+ (IPPTsPng * * owner )mem_valloc (dht -> mem , list_count * 2 , sizeof (IPPTsPng * ));
16991703 unsigned int sort = 0 ;
17001704 bool sort_ok = false;
17011705
@@ -2521,7 +2525,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw
25212525 return nullptr ;
25222526 }
25232527
2524- DHT * const dht = (DHT * )mem_alloc (mem , sizeof (DHT ));
2528+ DHT * const owner dht = (DHT * owner )mem_alloc (mem , sizeof (DHT ));
25252529
25262530 if (dht == nullptr ) {
25272531 LOGGER_ERROR (log , "failed to allocate DHT struct (%ld bytes)" , (unsigned long )sizeof (DHT ));
@@ -2620,7 +2624,7 @@ void do_dht(DHT *dht)
26202624 ping_iterate (dht -> ping );
26212625}
26222626
2623- void kill_dht (DHT * dht )
2627+ void kill_dht (DHT * owner dht )
26242628{
26252629 if (dht == nullptr ) {
26262630 return ;
@@ -2693,7 +2697,8 @@ void dht_save(const DHT *dht, uint8_t *data)
26932697 /* get right offset. we write the actual header later. */
26942698 data = state_write_section_header (data , DHT_STATE_COOKIE_TYPE , 0 , 0 );
26952699
2696- Node_format * clients = (Node_format * )mem_valloc (dht -> mem , MAX_SAVED_DHT_NODES , sizeof (Node_format ));
2700+ Node_format * owner clients =
2701+ (Node_format * owner )mem_valloc (dht -> mem , MAX_SAVED_DHT_NODES , sizeof (Node_format ));
26972702
26982703 if (clients == nullptr ) {
26992704 LOGGER_ERROR (dht -> log , "could not allocate %u nodes" , MAX_SAVED_DHT_NODES );
@@ -2790,7 +2795,8 @@ static State_Load_Status dht_load_state_callback(void *outer, const uint8_t *dat
27902795 mem_delete (dht -> mem , dht -> loaded_nodes_list );
27912796
27922797 // Copy to loaded_clients_list
2793- Node_format * nodes = (Node_format * )mem_valloc (dht -> mem , MAX_SAVED_DHT_NODES , sizeof (Node_format ));
2798+ Node_format * owner nodes =
2799+ (Node_format * owner )mem_valloc (dht -> mem , MAX_SAVED_DHT_NODES , sizeof (Node_format ));
27942800
27952801 if (nodes == nullptr ) {
27962802 LOGGER_ERROR (dht -> log , "could not allocate %u nodes" , MAX_SAVED_DHT_NODES );
0 commit comments