Skip to content

Commit d7863e9

Browse files
committed
[NFC] io white space / byte count related
1 parent c1976b7 commit d7863e9

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

io/io/inc/TBufferFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class TBufferFile : public TBufferIO {
117117

118118
TObject *ReadObject(const TClass *cl) override;
119119

120-
const ByteCountFinder_t& GetByteCounts() const { return fByteCounts; }
120+
const ByteCountFinder_t &GetByteCounts() const { return fByteCounts; }
121121
void SetByteCounts(ByteCountFinder_t &&byteCounts) { fByteCounts = std::move(byteCounts); }
122122

123123
void ResetMap() override;

io/io/src/TBufferFile.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void TBufferFile::SetByteCount(ULong64_t cntpos, Bool_t packInVersion)
340340
// which uses the stack to get the position and call the new one.
341341
// This (of course) also requires that we do the 'same' to the WriteVersion
342342
// routines.
343-
R__ASSERT( !fByteCountStack.empty() );
343+
R__ASSERT(!fByteCountStack.empty());
344344
if (cntpos == kMaxInt) {
345345
cntpos = fByteCountStack.back();
346346
}
@@ -435,7 +435,8 @@ Long64_t TBufferFile::CheckByteCount(ULong64_t startpos, ULong64_t bcnt, const T
435435
if ( ((char *)endpos) > fBufMax ) {
436436
offset = fBufMax-fBufCur;
437437
Error("CheckByteCount",
438-
"Byte count probably corrupted around buffer position %llu:\n\tByte count is %llu while the buffer size is %lld",
438+
"Byte count probably corrupted around buffer position %llu:\n\tByte count is %llu while the buffer size "
439+
"is %lld",
439440
startpos, bcnt, offset);
440441
fBufCur = fBufMax;
441442

io/io/test/testByteCount.C

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// SetBufferOffset does not check against the size,
77
// so we can provide and use a larger buffer.
88
std::vector<char> databuffer{};
9-
databuffer.reserve( 4*1024*1024*1024ll );
10-
TBufferFile b(TBuffer::kWrite, 2*1024*1024*1024ll-100, databuffer.data(), false /* don't adopt */);
9+
databuffer.reserve(4 * 1024 * 1024 * 1024ll);
10+
TBufferFile b(TBuffer::kWrite, 2 * 1024 * 1024 * 1024ll - 100, databuffer.data(), false /* don't adopt */);
1111
{
1212
// Regular object at offset 0
1313
UInt_t R__c = b.WriteVersion(TExMap::Class(), kTRUE);
@@ -23,13 +23,13 @@
2323
{
2424
// Object larger than 1GB
2525
UInt_t R__c = b.WriteVersion(TExMap::Class(), kTRUE);
26-
b.SetBufferOffset(4000+1*1024*1024*1024ll);
26+
b.SetBufferOffset(4000 + 1 * 1024 * 1024 * 1024ll);
2727
b.SetByteCount(R__c, kTRUE);
2828
}
2929
{
3030
// Regular object located past 1GB
3131
UInt_t R__c = b.WriteVersion(TExMap::Class(), kTRUE);
32-
b.SetBufferOffset(8000+1*1024*1024*1024ll);
32+
b.SetBufferOffset(8000 + 1 * 1024 * 1024 * 1024ll);
3333
b.SetByteCount(R__c, kTRUE);
3434
}
3535
{
@@ -40,18 +40,17 @@
4040
// However the lifting might be temporary, so this might need to be
4141
// moved to a test that stored objects in a TFile.
4242
UInt_t R__c = b.WriteVersion(TExMap::Class(), kTRUE);
43-
b.SetBufferOffset(12000+2*1024*1024*1024ll);
43+
b.SetBufferOffset(12000 + 2 * 1024 * 1024 * 1024ll);
4444
b.SetByteCount(R__c, kTRUE);
4545
}
4646

47-
4847
// To make a copy instead of using the const references:
49-
auto bytecounts{ b.GetByteCounts() };
48+
auto bytecounts{b.GetByteCounts()};
5049
if (bytecounts.size() != expectedByteCounts) {
5150
++errors;
5251
std::cerr << "The number of bytecount is not as expected (1), it is " << bytecounts.size() << '\n';
5352
std::cerr << "The full list is:\n";
54-
for(auto bc : bytecounts)
53+
for (auto bc : bytecounts)
5554
std::cerr << "values: " << bc.first << " , " << bc.second << '\n';
5655
}
5756

@@ -85,7 +84,7 @@
8584
{
8685
// Object larger than 1GB
8786
auto version = b.ReadVersion(&R__s, &R__c, TExMap::Class());
88-
b.SetBufferOffset(4000+1*1024*1024*1024ll);
87+
b.SetBufferOffset(4000 + 1 * 1024 * 1024 * 1024ll);
8988
auto res = b.CheckByteCount(R__s, R__c, TExMap::Class());
9089
if (res != 0) {
9190
++errors;
@@ -95,7 +94,7 @@
9594
{
9695
// Regular object located past 1GB
9796
auto version = b.ReadVersion(&R__s, &R__c, TExMap::Class());
98-
b.SetBufferOffset(8000+1*1024*1024*1024ll);
97+
b.SetBufferOffset(8000 + 1 * 1024 * 1024 * 1024ll);
9998
auto res = b.CheckByteCount(R__s, R__c, TExMap::Class());
10099
if (res != 0) {
101100
++errors;
@@ -106,7 +105,7 @@
106105
// Object larger than 1GB start after 1GB
107106
// NOTE: this does not yet fit.
108107
auto version = b.ReadVersion(&R__s, &R__c, TExMap::Class());
109-
b.SetBufferOffset(12000+2*1024*1024*1024ll);
108+
b.SetBufferOffset(12000 + 2 * 1024 * 1024 * 1024ll);
110109
auto res = b.CheckByteCount(R__s, R__c, TExMap::Class());
111110
if (res != 0) {
112111
++errors;

0 commit comments

Comments
 (0)