*/
#define _LGPL_SOURCE
+#include "tracefile-array.hpp"
+
#include <common/common.hpp>
-#include <common/utils.hpp>
#include <common/defaults.hpp>
-
-#include "tracefile-array.hpp"
+#include <common/utils.hpp>
struct tracefile_array *tracefile_array_create(size_t count)
{
- struct tracefile_array *tfa = NULL;
+ struct tracefile_array *tfa = nullptr;
int i;
tfa = zmalloc<tracefile_array>();
free(tfa->tf);
}
free(tfa);
- return NULL;
+ return nullptr;
}
void tracefile_array_destroy(struct tracefile_array *tfa)
tfa->file_tail = 0;
}
-void tracefile_array_file_rotate(struct tracefile_array *tfa,
- enum tracefile_rotate_type type)
+void tracefile_array_file_rotate(struct tracefile_array *tfa, enum tracefile_rotate_type type)
{
uint64_t *headp, *tailp;
}
}
-void tracefile_array_commit_seq(struct tracefile_array *tfa,
- uint64_t new_seq_head)
+void tracefile_array_commit_seq(struct tracefile_array *tfa, uint64_t new_seq_head)
{
uint64_t *headp, *tailp;
return tfa->seq_tail;
}
-bool tracefile_array_seq_in_file(struct tracefile_array *tfa,
- uint64_t file_index, uint64_t seq)
+bool tracefile_array_seq_in_file(struct tracefile_array *tfa, uint64_t file_index, uint64_t seq)
{
if (!tfa->count) {
/*
if (seq == -1ULL) {
return false;
}
- if (seq >= tfa->tf[file_index].seq_tail
- && seq <= tfa->tf[file_index].seq_head) {
- return true;
- } else {
- return false;
- }
+ return seq >= tfa->tf[file_index].seq_tail && seq <= tfa->tf[file_index].seq_head;
}