Commit 09af2d16 authored by Andreas Schmidt's avatar Andreas Schmidt

Fix bug in bptree and packetTimeoutTable.

parent 89431151
Pipeline #949 failed with stages
in 56 seconds
......@@ -70,6 +70,7 @@ List *PrrtPacketTimeoutTable_expire_packets(PrrtPacketTimeoutTable *table, prrtT
PrrtPacket *packet = current->value;
PrrtPacketDataPayload* payload = packet->payload;
table->packetList = BPTree_delete(table->packetList, payload->packetTimeout_us);
PrrtPacket_destroy(packet);
}
check(pthread_mutex_unlock(&table->lock) == EXIT_SUCCESS, "Unlock failed.");
......
......@@ -333,7 +333,7 @@ static BPTreeKey_t get_left_index(BPTreeNode *parent, BPTreeNode *left) {
*/
static BPTreeNode *insert_into_leaf(BPTreeNode *leaf, BPTreeKey_t key, BPTreeRecord *pointer) {
int i, insertion_point;
BPTreeKey_t i, insertion_point;
insertion_point = 0;
while (insertion_point < leaf->num_keys && leaf->keys[insertion_point] < key)
......@@ -360,7 +360,7 @@ static BPTreeNode *insert_into_leaf_after_splitting(BPTreeNode *root, BPTreeNode
BPTreeNode *new_leaf;
BPTreeKey_t *temp_keys;
void **temp_pointers;
int insertion_index, split, new_key, i, j;
BPTreeKey_t insertion_index, split, new_key, i, j;
new_leaf = make_leaf();
......@@ -529,7 +529,7 @@ static BPTreeNode *insert_into_node_after_splitting(BPTreeNode *root, BPTreeNode
*/
static BPTreeNode *insert_into_parent(BPTreeNode *root, BPTreeNode *left, BPTreeKey_t key, BPTreeNode *right) {
int left_index;
BPTreeKey_t left_index;
BPTreeNode *parent;
parent = left->parent;
......@@ -682,7 +682,7 @@ static BPTreeKey_t get_neighbor_index(BPTreeNode *n) {
static BPTreeNode *remove_entry_from_node(BPTreeNode *n, BPTreeKey_t key, BPTreeNode *pointer) {
int i, num_pointers;
BPTreeKey_t i, num_pointers;
// Remove the key and shift other keys accordingly.
i = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment