@@ -110,10 +110,10 @@ struct DHT {
110
110
uint8_t self_public_key [CRYPTO_PUBLIC_KEY_SIZE ];
111
111
uint8_t self_secret_key [CRYPTO_SECRET_KEY_SIZE ];
112
112
113
- DHT_Friend * friends_list ;
113
+ DHT_Friend * owner friends_list ;
114
114
uint16_t num_friends ;
115
115
116
- Node_format * loaded_nodes_list ;
116
+ Node_format * owner loaded_nodes_list ;
117
117
uint32_t loaded_num_nodes ;
118
118
unsigned int loaded_nodes_index ;
119
119
@@ -370,7 +370,7 @@ int dht_create_packet(const Memory *mem, const Random *rng,
370
370
uint8_t * packet , size_t length )
371
371
{
372
372
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 );
374
374
375
375
if (encrypted == nullptr ) {
376
376
return -1 ;
@@ -920,7 +920,7 @@ static void sort_client_list(const Memory *mem, Client_data *list, uint64_t cur_
920
920
{
921
921
// Pass comp_public_key to qsort with each Client_data entry, so the
922
922
// 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 ));
924
924
925
925
if (cmp_list == nullptr ) {
926
926
return ;
@@ -1591,7 +1591,8 @@ int dht_addfriend(DHT *dht, const uint8_t *public_key, dht_ip_cb *ip_callback,
1591
1591
return 0 ;
1592
1592
}
1593
1593
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 ));
1595
1596
1596
1597
if (temp == nullptr ) {
1597
1598
return -1 ;
@@ -1641,7 +1642,8 @@ int dht_delfriend(DHT *dht, const uint8_t *public_key, uint32_t lock_token)
1641
1642
return 0 ;
1642
1643
}
1643
1644
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 ));
1645
1647
1646
1648
if (temp == nullptr ) {
1647
1649
return -1 ;
@@ -1694,8 +1696,10 @@ static uint8_t do_ping_and_sendnode_requests(DHT *dht, uint64_t *lastgetnode, co
1694
1696
const uint64_t temp_time = mono_time_get (dht -> mono_time );
1695
1697
1696
1698
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 * ));
1699
1703
unsigned int sort = 0 ;
1700
1704
bool sort_ok = false;
1701
1705
@@ -2521,7 +2525,7 @@ DHT *new_dht(const Logger *log, const Memory *mem, const Random *rng, const Netw
2521
2525
return nullptr ;
2522
2526
}
2523
2527
2524
- DHT * const dht = (DHT * )mem_alloc (mem , sizeof (DHT ));
2528
+ DHT * const owner dht = (DHT * owner )mem_alloc (mem , sizeof (DHT ));
2525
2529
2526
2530
if (dht == nullptr ) {
2527
2531
LOGGER_ERROR (log , "failed to allocate DHT struct (%ld bytes)" , (unsigned long )sizeof (DHT ));
@@ -2620,7 +2624,7 @@ void do_dht(DHT *dht)
2620
2624
ping_iterate (dht -> ping );
2621
2625
}
2622
2626
2623
- void kill_dht (DHT * dht )
2627
+ void kill_dht (DHT * owner dht )
2624
2628
{
2625
2629
if (dht == nullptr ) {
2626
2630
return ;
@@ -2693,7 +2697,8 @@ void dht_save(const DHT *dht, uint8_t *data)
2693
2697
/* get right offset. we write the actual header later. */
2694
2698
data = state_write_section_header (data , DHT_STATE_COOKIE_TYPE , 0 , 0 );
2695
2699
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 ));
2697
2702
2698
2703
if (clients == nullptr ) {
2699
2704
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
2790
2795
mem_delete (dht -> mem , dht -> loaded_nodes_list );
2791
2796
2792
2797
// 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 ));
2794
2800
2795
2801
if (nodes == nullptr ) {
2796
2802
LOGGER_ERROR (dht -> log , "could not allocate %u nodes" , MAX_SAVED_DHT_NODES );
0 commit comments