Skip to content

[nfc] consistent renaming of all buffersize variables #19610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/base/inc/TBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class TBuffer : public TObject {
void operator=(const TBuffer &) = delete;

Int_t Read(const char *name) override { return TObject::Read(name); }
Int_t Write(const char *name, Int_t opt, Int_t bufs) override
{ return TObject::Write(name, opt, bufs); }
Int_t Write(const char *name, Int_t opt, Int_t bufs) const override
{ return TObject::Write(name, opt, bufs); }
Int_t Write(const char *name, Int_t opt, Int_t bufsize) override
{ return TObject::Write(name, opt, bufsize); }
Int_t Write(const char *name, Int_t opt, Int_t bufsize) const override
{ return TObject::Write(name, opt, bufsize); }

public:
enum EMode { kRead = 0, kWrite = 1 };
Expand All @@ -78,16 +78,16 @@ class TBuffer : public TObject {
enum { kInitialSize = 1024, kMinimalSize = 128 };

TBuffer(EMode mode);
TBuffer(EMode mode, Int_t bufsiz);
TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = nullptr);
TBuffer(EMode mode, Int_t bufsize);
TBuffer(EMode mode, Int_t bufsize, void *buf, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = nullptr);
virtual ~TBuffer();

Int_t GetBufferVersion() const { return fVersion; }
Bool_t IsReading() const { return (fMode & kWrite) == 0; }
Bool_t IsWriting() const { return (fMode & kWrite) != 0; }
void SetReadMode();
void SetWriteMode();
void SetBuffer(void *buf, UInt_t bufsiz = 0, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = nullptr);
void SetBuffer(void *buf, UInt_t bufsize = 0, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = nullptr);
ReAllocCharFun_t GetReAllocFunc() const;
void SetReAllocFunc(ReAllocCharFun_t reallocfunc = nullptr);
void SetBufferOffset(Int_t offset = 0) { fBufCur = fBuffer+offset; }
Expand Down
20 changes: 10 additions & 10 deletions core/base/src/TBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ TBuffer::TBuffer(EMode mode)
/// Create an I/O buffer object. Mode should be either TBuffer::kRead or
/// TBuffer::kWrite.

TBuffer::TBuffer(EMode mode, Int_t bufsiz)
TBuffer::TBuffer(EMode mode, Int_t bufsize)
{
if (bufsiz < 0)
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsiz, kMaxBufferSize);
if (bufsiz < kMinimalSize) bufsiz = kMinimalSize;
fBufSize = bufsiz;
if (bufsize < 0)
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsize, kMaxBufferSize);
if (bufsize < kMinimalSize) bufsize = kMinimalSize;
fBufSize = bufsize;
fMode = mode;
fVersion = 0;
fParent = nullptr;
Expand All @@ -101,11 +101,11 @@ TBuffer::TBuffer(EMode mode, Int_t bufsiz)
/// is provided, a Fatal error will be issued if the Buffer attempts to
/// expand.

TBuffer::TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt, ReAllocCharFun_t reallocfunc)
TBuffer::TBuffer(EMode mode, Int_t bufsize, void *buf, Bool_t adopt, ReAllocCharFun_t reallocfunc)
{
if (bufsiz < 0)
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsiz, kMaxBufferSize);
fBufSize = bufsiz;
if (bufsize < 0)
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsize, kMaxBufferSize);
fBufSize = bufsize;
fMode = mode;
fVersion = 0;
fParent = nullptr;
Expand Down Expand Up @@ -283,7 +283,7 @@ ReAllocCharFun_t TBuffer::GetReAllocFunc() const
/// Set which memory reallocation method to use. If reallocafunc is null,
/// reset it to the default value (TStorage::ReAlloc)

void TBuffer::SetReAllocFunc(ReAllocCharFun_t reallocfunc )
void TBuffer::SetReAllocFunc(ReAllocCharFun_t reallocfunc)
{
if (reallocfunc) {
fReAllocFunc = reallocfunc;
Expand Down
10 changes: 5 additions & 5 deletions core/cont/src/TCollection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -678,17 +678,17 @@ void TCollection::Streamer(TBuffer &b)
/// objects using a single key specify a name and set option to
/// TObject::kSingleKey (i.e. 1).

Int_t TCollection::Write(const char *name, Int_t option, Int_t bsize) const
Int_t TCollection::Write(const char *name, Int_t option, Int_t bufsize) const
{
if ((option & kSingleKey)) {
return TObject::Write(name, option, bsize);
return TObject::Write(name, option, bufsize);
} else {
option &= ~kSingleKey;
Int_t nbytes = 0;
TIter next(this);
TObject *obj;
while ((obj = next())) {
nbytes += obj->Write(name, option, bsize);
nbytes += obj->Write(name, option, bufsize);
}
return nbytes;
}
Expand All @@ -702,9 +702,9 @@ Int_t TCollection::Write(const char *name, Int_t option, Int_t bsize) const
/// objects using a single key specify a name and set option to
/// TObject::kSingleKey (i.e. 1).

Int_t TCollection::Write(const char *name, Int_t option, Int_t bsize)
Int_t TCollection::Write(const char *name, Int_t option, Int_t bufsize)
{
return ((const TCollection*)this)->Write(name,option,bsize);
return ((const TCollection*)this)->Write(name,option,bufsize);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions core/cont/src/TMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -402,20 +402,20 @@ void TMap::Streamer(TBuffer &b)
/// objects using a single key specify a name and set option to
/// TObject::kSingleKey (i.e. 1).

Int_t TMap::Write(const char *name, Int_t option, Int_t bsize) const
Int_t TMap::Write(const char *name, Int_t option, Int_t bufsize) const
{
if ((option & kSingleKey)) {
return TObject::Write(name, option, bsize);
return TObject::Write(name, option, bufsize);
} else {
option &= ~kSingleKey;
Int_t nbytes = 0;
TIter next(fTable);
TPair *a;
while ((a = (TPair*) next())) {
if (a->Key())
nbytes += a->Key()->Write(name, option, bsize);
nbytes += a->Key()->Write(name, option, bufsize);
if (a->Value())
nbytes += a->Value()->Write(name, option, bsize);
nbytes += a->Value()->Write(name, option, bufsize);
}
return nbytes;
}
Expand All @@ -429,9 +429,9 @@ Int_t TMap::Write(const char *name, Int_t option, Int_t bsize) const
/// objects using a single key specify a name and set option to
/// TObject::kSingleKey (i.e. 1).

Int_t TMap::Write(const char *name, Int_t option, Int_t bsize)
Int_t TMap::Write(const char *name, Int_t option, Int_t bufsize)
{
return ((const TMap*)this)->Write(name,option,bsize);
return ((const TMap*)this)->Write(name,option,bufsize);
}

/** \class TPair
Expand Down
2 changes: 1 addition & 1 deletion graf3d/g3d/inc/TXTRU.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TXTRU : public TShape {
private:
void DumpPoints(int npoints, float *pointbuff) const;
void DumpSegments(int nsegments, int *segbuff) const;
void DumpPolygons(int npolygons, int *polybuff, int buffsize) const;
void DumpPolygons(int npolygons, int *polybuff, int bufsize) const;

ClassDefOverride(TXTRU,1) //TXTRU shape
};
Expand Down
4 changes: 2 additions & 2 deletions graf3d/g3d/src/TXTRU.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ void TXTRU::DumpSegments(int nsegments, int *segbuff) const
////////////////////////////////////////////////////////////////////////////////
/// Dump the derived polygon info for visual inspection

void TXTRU::DumpPolygons(int npolygons, int *polybuff, int buffsize) const
void TXTRU::DumpPolygons(int npolygons, int *polybuff, int bufsize) const
{
std::cout << "TXTRU::DumpPolygons - " << npolygons << " polygons" << std::endl;
int ioff = 0;
Expand All @@ -729,7 +729,7 @@ void TXTRU::DumpPolygons(int npolygons, int *polybuff, int buffsize) const
}
std::cout << polybuff[ioff++] << ")" << std::endl;
}
std::cout << " buffer size " << buffsize << " last used " << --ioff << std::endl;
std::cout << " buffer size " << bufsize << " last used " << --ioff << std::endl;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions graf3d/gl/src/TGLOutput.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ Bool_t TGLOutput::CapturePostscript(TGLViewer & viewer, EFormat format, const ch
assert(kFALSE);
return kFALSE;
}
Int_t buffsize = 0, state = GL2PS_OVERFLOW;
Int_t bufsize = 0, state = GL2PS_OVERFLOW;
viewer.DoDraw();
viewer.fIsPrinting = kTRUE;
while (state == GL2PS_OVERFLOW) {
buffsize += 1024*1024;
bufsize += 1024*1024;
gl2psBeginPage ("ROOT Scene Graph", "ROOT", nullptr,
gl2psFormat, gl2psSort, GL2PS_USE_CURRENT_VIEWPORT
| GL2PS_SILENT | GL2PS_BEST_ROOT | GL2PS_OCCLUSION_CULL | 0,
GL_RGBA, 0, nullptr,0, 0, 0,
buffsize, output, nullptr);
bufsize, output, nullptr);
viewer.DoDraw();
state = gl2psEndPage();
std::cout << ".";
Expand Down Expand Up @@ -210,17 +210,17 @@ void TGLOutput::Capture(TGLViewer & viewer)

Int_t gl2psFormat = GL2PS_EPS;
Int_t gl2psSort = GL2PS_BSP_SORT;
Int_t buffsize = 0, state = GL2PS_OVERFLOW;
Int_t bufsize = 0, state = GL2PS_OVERFLOW;
viewer.DoDraw();
viewer.fIsPrinting = kTRUE;

while (state == GL2PS_OVERFLOW) {
buffsize += 1024*1024;
bufsize += 1024*1024;
gl2psBeginPage ("ROOT Scene Graph", "ROOT", nullptr,
gl2psFormat, gl2psSort, GL2PS_USE_CURRENT_VIEWPORT
| GL2PS_SILENT | GL2PS_BEST_ROOT | GL2PS_OCCLUSION_CULL | 0,
GL_RGBA, 0, nullptr,0, 0, 0,
buffsize, output, nullptr);
bufsize, output, nullptr);
viewer.DoDraw();
state = gl2psEndPage();
std::cout << ".";
Expand Down
6 changes: 3 additions & 3 deletions graf3d/gl/src/TGLPlotPainter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void TGLPlotPainter::PrintPlot()const

Int_t gl2psFormat = GL2PS_EPS;
Int_t gl2psSort = GL2PS_BSP_SORT;
Int_t buffsize = 0;
Int_t bufsize = 0;
Int_t state = GL2PS_OVERFLOW;
GLint gl2psoption = GL2PS_USE_CURRENT_VIEWPORT |
GL2PS_SILENT |
Expand All @@ -252,11 +252,11 @@ void TGLPlotPainter::PrintPlot()const
0;

while (state == GL2PS_OVERFLOW) {
buffsize += 1024*1024;
bufsize += 1024*1024;
gl2psBeginPage ("ROOT Scene Graph", "ROOT", nullptr,
gl2psFormat, gl2psSort, gl2psoption,
GL_RGBA, 0, nullptr,0, 0, 0,
buffsize, output, nullptr);
bufsize, output, nullptr);
DrawPlot();
state = gl2psEndPage();
}
Expand Down
4 changes: 2 additions & 2 deletions hist/hist/inc/TH1.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,13 @@ class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
const Double_t *zBins);
virtual void SetBinsLength(Int_t = -1) { } //redefined in derived classes
virtual void SetBinErrorOption(EBinErrorOpt type) { fBinStatErrOpt = type; }
virtual void SetBuffer(Int_t buffersize, Option_t *option="");
virtual void SetBuffer(Int_t bufsize, Option_t *option="");
virtual UInt_t SetCanExtend(UInt_t extendBitMask);
virtual void SetContent(const Double_t *content);
virtual void SetContour(Int_t nlevels, const Double_t *levels = nullptr);
virtual void SetContourLevel(Int_t level, Double_t value);
virtual void SetColors(Color_t linecolor = -1, Color_t markercolor = -1, Color_t fillcolor = -1);
static void SetDefaultBufferSize(Int_t buffersize=1000);
static void SetDefaultBufferSize(Int_t bufsize=1000);
static void SetDefaultSumw2(Bool_t sumw2=kTRUE);
virtual void SetDirectory(TDirectory *dir);
virtual void SetEntries(Double_t n) { fEntries = n; }
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/inc/TProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class TProfile : public TH1D {
void SetBins(Int_t nbins, Double_t xmin, Double_t xmax) override;
void SetBins(Int_t nx, const Double_t *xbins) override;
void SetBinsLength(Int_t n=-1) override;
void SetBuffer(Int_t buffersize, Option_t *option="") override;
void SetBuffer(Int_t bufsize, Option_t *option="") override;
virtual void SetErrorOption(Option_t *option=""); // *MENU*
void Sumw2(Bool_t flag = kTRUE) override;

Expand Down
2 changes: 1 addition & 1 deletion hist/hist/inc/TProfile2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class TProfile2D : public TH2D {
void SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax) override;
void SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins) override;
void SetBinsLength(Int_t n=-1) override;
void SetBuffer(Int_t buffersize, Option_t *option="") override;
void SetBuffer(Int_t bufsize, Option_t *option="") override;
virtual void SetErrorOption(Option_t *option=""); // *MENU*
void Sumw2(Bool_t flag = kTRUE) override;
Double_t GetNumberOfBins() { return fBinEntries.GetSize(); }
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/inc/TProfile3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class TProfile3D : public TH3D {
void SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t * yBins, Int_t nz,
const Double_t *zBins) override;
void SetBinsLength(Int_t n=-1) override;
void SetBuffer(Int_t buffersize, Option_t *opt="") override;
void SetBuffer(Int_t bufsize, Option_t *opt="") override;
virtual void SetErrorOption(Option_t *option=""); // *MENU*
void Sumw2(Bool_t flag = kTRUE) override;

Expand Down
12 changes: 6 additions & 6 deletions hist/hist/src/TH1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6728,9 +6728,9 @@ UInt_t TH1::GetAxisLabelStatus() const
/// or equal to its upper limit, the function SetBuffer is automatically
/// called with the default buffer size.

void TH1::SetDefaultBufferSize(Int_t buffersize)
void TH1::SetDefaultBufferSize(Int_t bufsize)
{
fgBufferSize = buffersize > 0 ? buffersize : 0;
fgBufferSize = bufsize > 0 ? bufsize : 0;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -8486,19 +8486,19 @@ Double_t TH1::GetContourLevelPad(Int_t level) const
////////////////////////////////////////////////////////////////////////////////
/// Set the maximum number of entries to be kept in the buffer.

void TH1::SetBuffer(Int_t buffersize, Option_t * /*option*/)
void TH1::SetBuffer(Int_t bufsize, Option_t * /*option*/)
{
if (fBuffer) {
BufferEmpty();
delete [] fBuffer;
fBuffer = nullptr;
}
if (buffersize <= 0) {
if (bufsize <= 0) {
fBufferSize = 0;
return;
}
if (buffersize < 100) buffersize = 100;
fBufferSize = 1 + buffersize*(fDimension+1);
if (bufsize < 100) bufsize = 100;
fBufferSize = 1 + bufsize*(fDimension+1);
fBuffer = new Double_t[fBufferSize];
memset(fBuffer, 0, sizeof(Double_t)*fBufferSize);
}
Expand Down
8 changes: 4 additions & 4 deletions hist/hist/src/TProfile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1742,19 +1742,19 @@ void TProfile::SetBinsLength(Int_t n)
////////////////////////////////////////////////////////////////////////////////
/// Set the buffer size in units of 8 bytes (double).

void TProfile::SetBuffer(Int_t buffersize, Option_t *)
void TProfile::SetBuffer(Int_t bufsize, Option_t *)
{
if (fBuffer) {
BufferEmpty();
delete [] fBuffer;
fBuffer = nullptr;
}
if (buffersize <= 0) {
if (bufsize <= 0) {
fBufferSize = 0;
return;
}
if (buffersize < 100) buffersize = 100;
fBufferSize = 1 + 3*buffersize;
if (bufsize < 100) bufsize = 100;
fBufferSize = 1 + 3*bufsize;
fBuffer = new Double_t[fBufferSize];
memset(fBuffer,0,sizeof(Double_t)*fBufferSize);
}
Expand Down
8 changes: 4 additions & 4 deletions hist/hist/src/TProfile2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1995,19 +1995,19 @@ void TProfile2D::SetBinsLength(Int_t n)
////////////////////////////////////////////////////////////////////////////////
/// Set the buffer size in units of 8 bytes (double).

void TProfile2D::SetBuffer(Int_t buffersize, Option_t *)
void TProfile2D::SetBuffer(Int_t bufsize, Option_t *)
{
if (fBuffer) {
BufferEmpty();
delete [] fBuffer;
fBuffer = nullptr;
}
if (buffersize <= 0) {
if (bufsize <= 0) {
fBufferSize = 0;
return;
}
if (buffersize < 100) buffersize = 100;
fBufferSize = 1 + 4*buffersize;
if (bufsize < 100) bufsize = 100;
fBufferSize = 1 + 4*bufsize;
fBuffer = new Double_t[fBufferSize];
memset(fBuffer,0,sizeof(Double_t)*fBufferSize);
}
Expand Down
8 changes: 4 additions & 4 deletions hist/hist/src/TProfile3D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1364,19 +1364,19 @@ void TProfile3D::SetBinsLength(Int_t n)
////////////////////////////////////////////////////////////////////////////////
/// Set the buffer size in units of 8 bytes (double).

void TProfile3D::SetBuffer(Int_t buffersize, Option_t *)
void TProfile3D::SetBuffer(Int_t bufsize, Option_t *)
{
if (fBuffer) {
BufferEmpty();
delete [] fBuffer;
fBuffer = nullptr;
}
if (buffersize <= 0) {
if (bufsize <= 0) {
fBufferSize = 0;
return;
}
if (buffersize < 100) buffersize = 100;
fBufferSize = 1 + 5*buffersize;
if (bufsize < 100) bufsize = 100;
fBufferSize = 1 + 5*bufsize;
fBuffer = new Double_t[fBufferSize];
memset(fBuffer,0,sizeof(Double_t)*fBufferSize);
}
Expand Down
Loading
Loading