Skip to content

Commit f93948d

Browse files
committed
[io] also change return argument to long64
1 parent c323880 commit f93948d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+219
-208
lines changed

core/base/inc/TBuffer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class TBuffer : public TObject {
6363
TBuffer(const TBuffer &) = delete;
6464
void operator=(const TBuffer &) = delete;
6565

66-
Int_t Read(const char *name) override { return TObject::Read(name); }
67-
Int_t Write(const char *name, Int_t opt, Long64_t bufsize) override
66+
Long64_t Read(const char *name) override { return TObject::Read(name); }
67+
Long64_t Write(const char *name, Int_t opt, Long64_t bufsize) override
6868
{ return TObject::Write(name, opt, bufsize); }
69-
Int_t Write(const char *name, Int_t opt, Long64_t bufsize) const override
69+
Long64_t Write(const char *name, Int_t opt, Long64_t bufsize) const override
7070
{ return TObject::Write(name, opt, bufsize); }
7171

7272
public:

core/base/inc/TDirectory.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ can be replaced with the simpler and exception safe:
247247
virtual void pwd() const;
248248
virtual void ReadAll(Option_t * /*option*/="") {}
249249
virtual Int_t ReadKeys(Bool_t /*forceRead*/=kTRUE) {return 0;}
250-
virtual Int_t ReadTObject(TObject * /*obj*/, const char * /*keyname*/) {return 0;}
250+
virtual Long64_t ReadTObject(TObject * /*obj*/, const char * /*keyname*/) {return 0;}
251251
virtual TObject *Remove(TObject*);
252252
void RecursiveRemove(TObject *obj) override;
253253
virtual void rmdir(const char *name);
254254
virtual void Save() {}
255-
virtual Int_t SaveObjectAs(const TObject * /*obj*/, const char * /*filename*/="", Option_t * /*option*/="") const;
255+
virtual Long64_t SaveObjectAs(const TObject * /*obj*/, const char * /*filename*/="", Option_t * /*option*/="") const;
256256
virtual void SaveSelf(Bool_t /*force*/ = kFALSE) {}
257257
virtual void SetBufferSize(Long64_t /* bufsize */) {}
258258
virtual void SetModified() {}
@@ -261,13 +261,13 @@ can be replaced with the simpler and exception safe:
261261
virtual void SetTRefAction(TObject * /*ref*/, TObject * /*parent*/) {}
262262
virtual void SetSeekDir(Long64_t) {}
263263
virtual void SetWritable(Bool_t) {}
264-
Int_t Sizeof() const override {return 0;}
265-
virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Long64_t /*bufsize*/=0) override {return 0;}
266-
virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Long64_t /*bufsize*/=0) const override {return 0;}
267-
virtual Int_t WriteTObject(const TObject *obj, const char *name =nullptr, Option_t * /*option*/="", Long64_t /*bufsize*/ =0);
264+
Long64_t Sizeof() const override {return 0;}
265+
virtual Long64_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Long64_t /*bufsize*/=0) override {return 0;}
266+
virtual Long64_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Long64_t /*bufsize*/=0) const override {return 0;}
267+
virtual Long64_t WriteTObject(const TObject *obj, const char *name =nullptr, Option_t * /*option*/="", Long64_t /*bufsize*/ =0);
268268
private:
269269
/// \cond HIDDEN_SYMBOLS
270-
Int_t WriteObject(void *obj, const char* name, Option_t *option="", Long64_t bufsize=0); // Intentionally not implemented.
270+
Long64_t WriteObject(void *obj, const char* name, Option_t *option="", Long64_t bufsize=0); // Intentionally not implemented.
271271
/// \endcond
272272
public:
273273
/// \brief Write an object with proper type checking.
@@ -293,13 +293,13 @@ can be replaced with the simpler and exception safe:
293293
/// This overload takes care of instances of classes that are derived from
294294
/// TObject. The method redirects to TDirectory::WriteTObject.
295295
template <typename T>
296-
inline std::enable_if_t<std::is_base_of<TObject, T>::value, Int_t>
296+
inline std::enable_if_t<std::is_base_of<TObject, T>::value, Long64_t>
297297
WriteObject(const T *obj, const char *name, Option_t *option = "", Long64_t bufsize = 0)
298298
{
299299
return WriteTObject(obj, name, option, bufsize);
300300
}
301-
virtual Int_t WriteObjectAny(const void *, const char * /*classname*/, const char * /*name*/, Option_t * /*option*/="", Long64_t /*bufsize*/ =0) {return 0;}
302-
virtual Int_t WriteObjectAny(const void *, const TClass * /*cl*/, const char * /*name*/, Option_t * /*option*/="", Long64_t /*bufsize*/ =0) {return 0;}
301+
virtual Long64_t WriteObjectAny(const void *, const char * /*classname*/, const char * /*name*/, Option_t * /*option*/="", Long64_t /*bufsize*/ =0) {return 0;}
302+
virtual Long64_t WriteObjectAny(const void *, const TClass * /*cl*/, const char * /*name*/, Option_t * /*option*/="", Long64_t /*bufsize*/ =0) {return 0;}
303303
virtual void WriteDirHeader() {}
304304
virtual void WriteKeys() {}
305305

core/base/inc/TNamed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TNamed : public TObject {
5555
virtual void SetTitle(const char *title=""); // *MENU*
5656
void ls(Option_t *option="") const override;
5757
void Print(Option_t *option="") const override;
58-
virtual Int_t Sizeof() const;
58+
virtual Long64_t Sizeof() const;
5959

6060
ClassDefOverride(TNamed,1) //The basis for a named object (name, title)
6161
};

core/base/inc/TObject.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,20 @@ class TObject {
163163
virtual void Paint(Option_t *option="");
164164
virtual void Pop();
165165
virtual void Print(Option_t *option="") const;
166-
virtual Int_t Read(const char *name);
166+
virtual Long64_t Read(const char *name);
167167
virtual void RecursiveRemove(TObject *obj);
168168
virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
169169
virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
170170
virtual void SetDrawOption(Option_t *option=""); // *MENU*
171171
virtual void SetUniqueID(UInt_t uid);
172172
virtual void UseCurrentStyle();
173-
virtual Int_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0);
174-
virtual Int_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) const;
173+
virtual Long64_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0);
174+
virtual Long64_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) const;
175+
/// \deprecated Please override the `Long64_t` overload instead of the `Int_t` version.
176+
[[deprecated]] Int_t Write(const char *name, Int_t option, Int_t bufsize)
177+
{ return Write(name, option, (Long64_t)bufsize); }
178+
[[deprecated]] Int_t Write(const char *name, Int_t option, Int_t bufsize) const
179+
{ return Write(name, option, (Long64_t)bufsize); }
175180

176181
/// IsDestructed
177182
///

core/base/src/TDirectory.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,12 +1254,12 @@ void TDirectory::rmdir(const char *name)
12541254
/// JavaScript ROOT (https://root.cern/js/) to display object in web browser
12551255
/// When creating JSON file, option string may contain compression level from 0 to 3 (default 0)
12561256

1257-
Int_t TDirectory::SaveObjectAs(const TObject *obj, const char *filename, Option_t *option) const
1257+
Long64_t TDirectory::SaveObjectAs(const TObject *obj, const char *filename, Option_t *option) const
12581258
{
12591259
// option can contain single letter args: "a" for append, "q" for quiet in any combinations
12601260

12611261
if (!obj) return 0;
1262-
Int_t nbytes = 0;
1262+
Long64_t nbytes = 0;
12631263
TString fname, opt = option, cmd;
12641264
if (filename && *filename)
12651265
fname = filename;
@@ -1426,7 +1426,7 @@ void TDirectory::RegisterGDirectory(TDirectory::SharedGDirectory_t &gdirectory_p
14261426
////////////////////////////////////////////////////////////////////////////////
14271427
/// \copydoc TDirectoryFile::WriteObject(const T*,const char*,Option_t*,Long64_t).
14281428

1429-
Int_t TDirectory::WriteTObject(const TObject *obj, const char *name, Option_t * /*option*/, Long64_t /*bufsize*/)
1429+
Long64_t TDirectory::WriteTObject(const TObject *obj, const char *name, Option_t * /*option*/, Long64_t /*bufsize*/)
14301430
{
14311431
const char *objname = "no name specified";
14321432
if (name) objname = name;

core/base/src/TNamed.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ void TNamed::SetTitle(const char *title)
179179
////////////////////////////////////////////////////////////////////////////////
180180
/// Return size of the TNamed part of the TObject.
181181

182-
Int_t TNamed::Sizeof() const
182+
Long64_t TNamed::Sizeof() const
183183
{
184-
Int_t nbytes = fName.Sizeof() + fTitle.Sizeof();
184+
Long64_t nbytes = fName.Sizeof() + fTitle.Sizeof();
185185
return nbytes;
186186
}

core/base/src/TObject.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ void TObject::Print(Option_t *) const
664664
/// The object must have been created before via the default constructor.
665665
/// See TObject::Write().
666666

667-
Int_t TObject::Read(const char *name)
667+
Long64_t TObject::Read(const char *name)
668668
{
669669
if (gDirectory)
670670
return gDirectory->ReadTObject(this,name);
@@ -939,7 +939,7 @@ void TObject::UseCurrentStyle()
939939
/// The function returns the total number of bytes written to the file.
940940
/// It returns 0 if the object cannot be written.
941941

942-
Int_t TObject::Write(const char *name, Int_t option, Long64_t bufsize) const
942+
Long64_t TObject::Write(const char *name, Int_t option, Long64_t bufsize) const
943943
{
944944
if (R__unlikely(option & kOnlyPrepStep))
945945
return 0;
@@ -961,7 +961,7 @@ Int_t TObject::Write(const char *name, Int_t option, Long64_t bufsize) const
961961
/// Write this object to the current directory. For more see the
962962
/// const version of this method.
963963

964-
Int_t TObject::Write(const char *name, Int_t option, Long64_t bufsize)
964+
Long64_t TObject::Write(const char *name, Int_t option, Long64_t bufsize)
965965
{
966966
return ((const TObject*)this)->Write(name, option, bufsize);
967967
}

core/cont/inc/TCollection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ class TCollection : public TObject {
207207
void SetName(const char *name) { fName = name; }
208208
virtual void SetOwner(Bool_t enable = kTRUE);
209209
virtual bool UseRWLock(Bool_t enable = true);
210-
Int_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) override;
211-
Int_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) const override;
210+
Long64_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) override;
211+
Long64_t Write(const char *name = nullptr, Int_t option = 0, Long64_t bufsize = 0) const override;
212212

213213
R__ALWAYS_INLINE Bool_t IsUsingRWLock() const { return TestBit(TCollection::kUseRWLock); }
214214

core/cont/inc/TMap.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ friend class TMapIter;
8484
TPair *RemoveEntry(TObject *key);
8585
virtual void SetOwnerValue(Bool_t enable = kTRUE);
8686
virtual void SetOwnerKeyValue(Bool_t ownkeys = kTRUE, Bool_t ownvals = kTRUE);
87-
Int_t Write(const char *name=nullptr, Int_t option=0, Long64_t bufsize=0) override;
88-
Int_t Write(const char *name=nullptr, Int_t option=0, Long64_t bufsize=0) const override;
87+
Long64_t Write(const char *name=nullptr, Int_t option=0, Long64_t bufsize=0) override;
88+
Long64_t Write(const char *name=nullptr, Int_t option=0, Long64_t bufsize=0) const override;
89+
Int_t Write(const char *name = nullptr, Int_t option = 0, Int_t bufsize = 0) const {return Write(name,option,(Long64_t)bufsize);};
8990

9091
ClassDefOverride(TMap,3) //A (key,value) map
9192
};

core/cont/src/TCollection.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,13 @@ void TCollection::Streamer(TBuffer &b)
676676
/// objects using a single key specify a name and set option to
677677
/// TObject::kSingleKey (i.e. 1).
678678

679-
Int_t TCollection::Write(const char *name, Int_t option, Long64_t bufsize) const
679+
Long64_t TCollection::Write(const char *name, Int_t option, Long64_t bufsize) const
680680
{
681681
if ((option & kSingleKey)) {
682682
return TObject::Write(name, option, bufsize);
683683
} else {
684684
option &= ~kSingleKey;
685-
Int_t nbytes = 0;
685+
Long64_t nbytes = 0;
686686
TIter next(this);
687687
TObject *obj;
688688
while ((obj = next())) {
@@ -700,7 +700,7 @@ Int_t TCollection::Write(const char *name, Int_t option, Long64_t bufsize) const
700700
/// objects using a single key specify a name and set option to
701701
/// TObject::kSingleKey (i.e. 1).
702702

703-
Int_t TCollection::Write(const char *name, Int_t option, Long64_t bufsize)
703+
Long64_t TCollection::Write(const char *name, Int_t option, Long64_t bufsize)
704704
{
705705
return ((const TCollection*)this)->Write(name,option,bufsize);
706706
}

0 commit comments

Comments
 (0)