mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Use VLA macro
This commit is contained in:
parent
1cc119c7a3
commit
b2d04eae9d
|
@ -867,7 +867,7 @@ static void sort_client_list(Client_data *list, unsigned int length, const uint8
|
|||
{
|
||||
// Pass comp_public_key to qsort with each Client_data entry, so the
|
||||
// comparison function can use it as the base of comparison.
|
||||
Cmp_data cmp_list[length];
|
||||
VLA(Cmp_data, cmp_list, length);
|
||||
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
cmp_list[i].base_public_key = comp_public_key;
|
||||
|
|
|
@ -279,7 +279,7 @@ static void sort_onion_announce_list(Onion_Announce_Entry *list, unsigned int le
|
|||
{
|
||||
// Pass comp_public_key to qsort with each Client_data entry, so the
|
||||
// comparison function can use it as the base of comparison.
|
||||
Cmp_data cmp_list[length];
|
||||
VLA(Cmp_data, cmp_list, length);
|
||||
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
cmp_list[i].base_public_key = comp_public_key;
|
||||
|
|
|
@ -517,7 +517,7 @@ static void sort_onion_node_list(Onion_Node *list, unsigned int length, const ui
|
|||
{
|
||||
// Pass comp_public_key to qsort with each Client_data entry, so the
|
||||
// comparison function can use it as the base of comparison.
|
||||
Cmp_data cmp_list[length];
|
||||
VLA(Cmp_data, cmp_list, length);
|
||||
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
cmp_list[i].base_public_key = comp_public_key;
|
||||
|
|
Loading…
Reference in New Issue
Block a user