projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clang-tidy: add Chrome-inspired checks
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
tracefile-array.cpp
diff --git
a/src/bin/lttng-relayd/tracefile-array.cpp
b/src/bin/lttng-relayd/tracefile-array.cpp
index 05012b642cc40f6f6c913806e808b56d488e45d5..b59e2aea17c8e493827cdf40cb1ffa9ffb28e09c 100644
(file)
--- a/
src/bin/lttng-relayd/tracefile-array.cpp
+++ b/
src/bin/lttng-relayd/tracefile-array.cpp
@@
-6,22
+6,22
@@
*/
#define _LGPL_SOURCE
*/
#define _LGPL_SOURCE
-#include <common/common.h>
-#include <common/utils.h>
-#include <common/defaults.h>
+#include "tracefile-array.hpp"
-#include "tracefile-array.h"
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/utils.hpp>
struct tracefile_array *tracefile_array_create(size_t count)
{
struct tracefile_array *tracefile_array_create(size_t count)
{
- struct tracefile_array *tfa =
NULL
;
+ struct tracefile_array *tfa =
nullptr
;
int i;
int i;
- tfa =
(tracefile_array *) zmalloc(sizeof(*tfa)
);
+ tfa =
zmalloc<tracefile_array>(
);
if (!tfa) {
goto error;
}
if (!tfa) {
goto error;
}
- tfa->tf =
(tracefile *) zmalloc(sizeof(*tfa->tf) *
count);
+ tfa->tf =
calloc<tracefile>(
count);
if (!tfa->tf) {
goto error;
}
if (!tfa->tf) {
goto error;
}
@@
-39,7
+39,7
@@
error:
free(tfa->tf);
}
free(tfa);
free(tfa->tf);
}
free(tfa);
- return
NULL
;
+ return
nullptr
;
}
void tracefile_array_destroy(struct tracefile_array *tfa)
}
void tracefile_array_destroy(struct tracefile_array *tfa)
@@
-67,8
+67,7
@@
void tracefile_array_reset(struct tracefile_array *tfa)
tfa->file_tail = 0;
}
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;
{
uint64_t *headp, *tailp;
@@
-109,8
+108,7
@@
void tracefile_array_file_rotate(struct tracefile_array *tfa,
}
}
}
}
-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;
{
uint64_t *headp, *tailp;
@@
-157,8
+155,7
@@
uint64_t tracefile_array_get_seq_tail(struct tracefile_array *tfa)
return tfa->seq_tail;
}
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 (!tfa->count) {
/*
@@
-171,8
+168,7
@@
bool tracefile_array_seq_in_file(struct tracefile_array *tfa,
if (seq == -1ULL) {
return false;
}
if (seq == -1ULL) {
return false;
}
- if (seq >= tfa->tf[file_index].seq_tail
- && seq <= tfa->tf[file_index].seq_head) {
+ if (seq >= tfa->tf[file_index].seq_tail && seq <= tfa->tf[file_index].seq_head) {
return true;
} else {
return false;
return true;
} else {
return false;
This page took
0.038317 seconds
and
4
git commands to generate.