Skip to content

Commit 41e08aa

Browse files
clang comments
Signed-off-by: AdityaPandeyCN <[email protected]>
1 parent 3c7b439 commit 41e08aa

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

src/ramcore/RAMNTupleView.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#include "ramcore/RAMNTupleView.h"
2+
23
#include <cstdint>
3-
#include <iostream>
4-
#include <string>
54
#include <cstring>
5+
#include <iostream>
66
#include <limits>
7+
#include <string>
8+
79
#include <ROOT/RNTuple.hxx>
810
#include <ROOT/RNTupleReader.hxx>
911
#include <ROOT/RNTupleView.hxx>
@@ -177,7 +179,8 @@ Long64_t ramntupleview(const char *file, const char *query, bool cache, bool per
177179
}
178180

179181
stopwatch.Print();
180-
printf("Found %lld records in region %s\n", static_cast<long long>(count), query ? query : "");
182+
std::cout << "Found " << static_cast<long long>(count) << " records in region "
183+
<< (query ? query : "") << std::endl;
181184
return count;
182185
}
183186

src/ramcore/SamToNTuple.cxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <TFile.h>
1414
#include <TROOT.h>
1515

16+
#include <cstdint>
1617
#include <map>
1718
#include <memory>
1819
#include <cstdio>
@@ -33,11 +34,11 @@ void samtoramntuple(const char *datafile,
3334
TStopwatch stopwatch;
3435
stopwatch.Start();
3536

36-
auto rootFile = std::unique_ptr<TFile>(TFile::Open(treefile, "RECREATE"));
37-
if (!rootFile || !rootFile->IsOpen()) {
38-
printf("Failed to create RAM file %s\n", treefile);
39-
return;
40-
}
37+
auto rootFile = std::unique_ptr<TFile>(TFile::Open(treefile, "RECREATE"));
38+
if (!rootFile || !rootFile->IsOpen()) {
39+
std::cerr << "Failed to create RAM file " << treefile << std::endl;
40+
return;
41+
}
4142

4243
RAMNTupleRecord::InitializeRefs();
4344

@@ -300,3 +301,4 @@ void samtoramntuple_split_by_chromosome(const char *datafile, const char *output
300301
}
301302
}
302303
}
304+

test/ramcoretests.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <cstdio>
1010
#include <cstdlib>
1111
#include <filesystem>
12-
#include <regex>
12+
1313
#include "../tools/ramview.cxx"
1414

1515
class ramcoreTest : public ::testing::Test {
@@ -55,14 +55,15 @@ TEST_F(ramcoreTest, ConversionProducesEqualEntries) {
5555
const char *region = "chrM:1-100000000";
5656

5757
testing::internal::CaptureStdout();
58-
ramview(ttreeFile, region, true, false, nullptr);
58+
ramview(ttreeFile, region, /*cache=*/true, /*perfstats=*/false, nullptr);
5959
std::string ramview_output = testing::internal::GetCapturedStdout();
6060

6161
testing::internal::CaptureStdout();
62-
ramntupleview(rntupleFile, region, true, false, nullptr);
62+
ramntupleview(rntupleFile, region, /*cache=*/true, /*perfstats=*/false, nullptr);
6363
std::string ramntupleview_output = testing::internal::GetCapturedStdout();
6464

6565
EXPECT_TRUE(ramview_output.find("Found") != std::string::npos);
6666
EXPECT_TRUE(ramntupleview_output.find("Found") != std::string::npos);
6767
EXPECT_TRUE(ramntupleview_output.find("records in region") != std::string::npos);
6868
}
69+

tools/ramview.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Long64_t ramview(const char *file, const char *query, bool cache = true, bool pe
6666
auto end_entry = RAMRecord::GetIndex()->GetRow(refid, re0);
6767

6868
printf("ramview: %s:%d (%lld) - %d (%lld)\n", rname.Data(), range_start, start_entry,
69-
range_end, end_entry);
69+
range_end, end_entry);
7070

7171
if (b->GetSplitLevel() > 0)
7272
t->SetBranchStatus("RAMRecord.*", 0);
@@ -119,7 +119,8 @@ Long64_t ramview(const char *file, const char *query, bool cache = true, bool pe
119119

120120
std::string region_str =
121121
std::string(rname.Data()) + ":" + std::to_string(range_start) + "-" + std::to_string(range_end);
122-
printf("Found %lld records in region %s\n", static_cast<long long>(count), region_str.c_str());
122+
std::cout << "Found " << static_cast<long long>(count) << " records in region "
123+
<< region_str << std::endl;
123124

124125
if (perfstats) {
125126
ps->SaveAs(perfstatsfilename);

0 commit comments

Comments
 (0)