From dd57b77d3b828fe93e6cc7090a9929a3805f1b27 Mon Sep 17 00:00:00 2001 From: Rene Brun <Rene.Brun@cern.ch> Date: Fri, 28 Dec 2007 12:28:46 +0000 Subject: [PATCH] Functions referencing a static global cannot be inlined. git-svn-id: http://root.cern.ch/svn/root/trunk@21565 27541ba8-7e3a-0410-8455-c3a389f83636 --- eve/inc/TEveElement.h | 2 +- eve/inc/TEveTrack.h | 2 +- eve/src/TEveElement.cxx | 9 ++++++++ eve/src/TEveTrack.cxx | 11 +++++++++ fitpanel/inc/TFitEditor.h | 2 +- fitpanel/src/TFitEditor.cxx | 9 ++++++++ ged/inc/TStyleManager.h | 2 +- ged/src/TStyleManager.cxx | 7 ++++++ geombuilder/inc/TGeoTabManager.h | 2 +- geombuilder/src/TGeoTabManager.cxx | 7 ++++++ gl/inc/TGLSelectBuffer.h | 2 +- gl/inc/TGLUtil.h | 10 ++++----- gl/src/TGLSelectBuffer.cxx | 7 ++++++ gl/src/TGLUtil.cxx | 36 ++++++++++++++++++++++++++++++ table/inc/TDataSet.h | 3 +-- table/inc/TDataSetIter.h | 2 -- table/inc/TIndexTable.h | 4 ++-- table/inc/TTableDescriptor.h | 4 ++-- table/src/TDataSet.cxx | 17 ++++++++++++++ table/src/TDataSetIter.cxx | 15 +++++++++++++ table/src/TIndexTable.cxx | 16 +++++++++++++ table/src/TTableDescriptor.cxx | 15 +++++++++++++ vmc/inc/TVirtualMC.h | 2 +- vmc/src/TVirtualMC.cxx | 8 +++++++ 24 files changed, 174 insertions(+), 20 deletions(-) diff --git a/eve/inc/TEveElement.h b/eve/inc/TEveElement.h index 0ec972af1eb..ba13ce965ad 100644 --- a/eve/inc/TEveElement.h +++ b/eve/inc/TEveElement.h @@ -195,7 +195,7 @@ public: virtual TEveTrans* PtrMainHMTrans() { return 0; } static const TGPicture* GetCheckBoxPicture(Bool_t rnrElement, Bool_t rnrDaughter); - virtual const TGPicture* GetListTreeIcon() { return fgListTreeIcons[0]; } + virtual const TGPicture* GetListTreeIcon(); ClassDef(TEveElement, 1); // Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and list-tree item management. }; diff --git a/eve/inc/TEveTrack.h b/eve/inc/TEveTrack.h index 363e3c5b600..32f05d0ff68 100644 --- a/eve/inc/TEveTrack.h +++ b/eve/inc/TEveTrack.h @@ -96,7 +96,7 @@ public: virtual void CtrlClicked(TEveTrack*); // *SIGNAL* virtual void SetLineStyle(Style_t lstyle); - virtual const TGPicture* GetListTreeIcon() { return fgListTreeIcons[4]; }; + virtual const TGPicture* GetListTreeIcon(); virtual TClass* ProjectedClass() const; diff --git a/eve/src/TEveElement.cxx b/eve/src/TEveElement.cxx index 7f7d011c83d..268de16da90 100644 --- a/eve/src/TEveElement.cxx +++ b/eve/src/TEveElement.cxx @@ -782,6 +782,15 @@ TEveElement::GetCheckBoxPicture(Bool_t rnrSelf, Bool_t rnrDaughters) return fgRnrIcons[idx]; } +//______________________________________________________________________________ +const TGPicture* +TEveElement::GetListTreeIcon() +{ + // Returns pointer to first listtreeicon + + return fgListTreeIcons[0]; +} + //______________________________________________________________________________ // TEveElementObjectPtr diff --git a/eve/src/TEveTrack.cxx b/eve/src/TEveTrack.cxx index 4c3775d50db..fb4a1de4474 100644 --- a/eve/src/TEveTrack.cxx +++ b/eve/src/TEveTrack.cxx @@ -173,6 +173,17 @@ TEveTrack::~TEveTrack() delete *i; } + +//______________________________________________________________________________ +const TGPicture* +TEveTrack::GetListTreeIcon() +{ + // Returns pointer to listtree track icon + + return fgListTreeIcons[4]; +} + + /******************************************************************************/ //______________________________________________________________________________ diff --git a/fitpanel/inc/TFitEditor.h b/fitpanel/inc/TFitEditor.h index 916bbb36adf..dac65265838 100644 --- a/fitpanel/inc/TFitEditor.h +++ b/fitpanel/inc/TFitEditor.h @@ -162,7 +162,7 @@ public: TFitEditor(TVirtualPad* pad, TObject *obj); virtual ~TFitEditor(); - static TFitEditor *&GetFP() { return fgFitDialog; } + static TFitEditor *&GetFP(); static void Open(TVirtualPad* pad, TObject *obj); virtual Option_t *GetDrawOption() const; virtual void Hide(); diff --git a/fitpanel/src/TFitEditor.cxx b/fitpanel/src/TFitEditor.cxx index 41a02a011b1..591d27aba42 100644 --- a/fitpanel/src/TFitEditor.cxx +++ b/fitpanel/src/TFitEditor.cxx @@ -971,6 +971,7 @@ void TFitEditor::Show(TVirtualPad* pad, TObject *obj) SetCanvas(pad->GetCanvas()); fCanvas->Selected(pad, obj, kButton1Down); } + //______________________________________________________________________________ void TFitEditor::CloseWindow() { @@ -979,6 +980,14 @@ void TFitEditor::CloseWindow() Hide(); } +//______________________________________________________________________________ +TFitEditor *&TFitEditor::GetFP() +{ + // Static: return main fit panel + + return fgFitDialog; +} + //______________________________________________________________________________ void TFitEditor::Terminate() { diff --git a/ged/inc/TStyleManager.h b/ged/inc/TStyleManager.h index c3321b678a6..75cfa695996 100644 --- a/ged/inc/TStyleManager.h +++ b/ged/inc/TStyleManager.h @@ -458,7 +458,7 @@ public: static void Show(); static void Terminate(); - static TStyleManager *&GetSM() { return fgStyleManager; } + static TStyleManager *&GetSM(); void Init(); void Hide(); diff --git a/ged/src/TStyleManager.cxx b/ged/src/TStyleManager.cxx index b9394fe0556..c8ddfc4c2d5 100644 --- a/ged/src/TStyleManager.cxx +++ b/ged/src/TStyleManager.cxx @@ -751,6 +751,13 @@ TStyleManager::~TStyleManager() fgStyleManager = 0; } +//______________________________________________________________________________ +TStyleManager *&TStyleManager::GetSM() +{ + //static: return style manager + return fgStyleManager; +} + //______________________________________________________________________________ void TStyleManager::Init() { diff --git a/geombuilder/inc/TGeoTabManager.h b/geombuilder/inc/TGeoTabManager.h index 889a3525975..b9ba2cfe578 100644 --- a/geombuilder/inc/TGeoTabManager.h +++ b/geombuilder/inc/TGeoTabManager.h @@ -117,7 +117,7 @@ public: TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1); virtual ~TGeoTreeDialog(); - static TObject *GetSelected() {return fgSelectedObj;} + static TObject *GetSelected(); // Slots virtual void DoClose() = 0; virtual void DoItemClick(TGListTreeItem *item, Int_t btn) = 0; diff --git a/geombuilder/src/TGeoTabManager.cxx b/geombuilder/src/TGeoTabManager.cxx index 26c2a4490f5..e21cede3c70 100644 --- a/geombuilder/src/TGeoTabManager.cxx +++ b/geombuilder/src/TGeoTabManager.cxx @@ -259,6 +259,13 @@ ClassImp(TGeoTreeDialog) TObject *TGeoTreeDialog::fgSelectedObj = 0; +//______________________________________________________________________________ +TObject *TGeoTreeDialog::GetSelected() +{ + //static; return selected object + return fgSelectedObj; +} + //______________________________________________________________________________ TGeoTreeDialog::TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w, UInt_t h) :TGTransientFrame(main, main, w, h) diff --git a/gl/inc/TGLSelectBuffer.h b/gl/inc/TGLSelectBuffer.h index cd39ec3f9cb..566066f224a 100644 --- a/gl/inc/TGLSelectBuffer.h +++ b/gl/inc/TGLSelectBuffer.h @@ -45,7 +45,7 @@ public: UInt_t* GetBuf() const { return fBuf; } Int_t GetNRecords() const { return fNRecords; } - Bool_t CanGrow() { return fBufSize < fgMaxBufSize; } + Bool_t CanGrow(); void Grow(); void ProcessResult(Int_t glResult); diff --git a/gl/inc/TGLUtil.h b/gl/inc/TGLUtil.h index f6152d21718..5bb00487df6 100644 --- a/gl/inc/TGLUtil.h +++ b/gl/inc/TGLUtil.h @@ -919,14 +919,14 @@ public: enum ELineHeadShape { kLineHeadNone, kLineHeadArrow, kLineHeadBox }; enum EAxesType { kAxesNone, kAxesEdge, kAxesOrigin }; - static void SetDrawQuality(UInt_t dq) { fgDrawQuality = dq; } - static void ResetDrawQuality() { fgDrawQuality = fgDefaultDrawQuality; } - static UInt_t GetDefaultDrawQuality() { return fgDefaultDrawQuality; } - static void SetDefaultDrawQuality(UInt_t dq) { fgDefaultDrawQuality = dq; } + static void SetDrawQuality(UInt_t dq); + static void ResetDrawQuality(); + static UInt_t GetDefaultDrawQuality(); + static void SetDefaultDrawQuality(UInt_t dq); static UInt_t LockColor(); static UInt_t UnlockColor(); - static Bool_t IsColorLocked() { return fgColorLockCount != 0; } + static Bool_t IsColorLocked(); static void Color(Color_t color_index, Float_t alpha=1); static void Color3ub(UChar_t r, UChar_t g, UChar_t b); diff --git a/gl/src/TGLSelectBuffer.cxx b/gl/src/TGLSelectBuffer.cxx index 85b23edf31a..c8ca4e10a8a 100644 --- a/gl/src/TGLSelectBuffer.cxx +++ b/gl/src/TGLSelectBuffer.cxx @@ -40,6 +40,13 @@ TGLSelectBuffer::~TGLSelectBuffer() delete [] fBuf; } +//______________________________________________________________________________ +Bool_t TGLSelectBuffer::CanGrow() +{ + //static: return true if current buffer is smaller than the max buffer size + return fBufSize < fgMaxBufSize; +} + //______________________________________________________________________________ void TGLSelectBuffer::Grow() { diff --git a/gl/src/TGLUtil.cxx b/gl/src/TGLUtil.cxx index 2183de1ec50..0d81a71f2c9 100644 --- a/gl/src/TGLUtil.cxx +++ b/gl/src/TGLUtil.cxx @@ -975,6 +975,42 @@ UInt_t TGLUtil::fgDefaultDrawQuality = 60; UInt_t TGLUtil::fgDrawQuality = fgDefaultDrawQuality; UInt_t TGLUtil::fgColorLockCount = 0; + +//______________________________________________________________________________ +void TGLUtil::SetDrawQuality(UInt_t dq) +{ + //static: set draw quality + fgDrawQuality = dq; +} + +//______________________________________________________________________________ +void TGLUtil::ResetDrawQuality() +{ + //static: reset draw quality + fgDrawQuality = fgDefaultDrawQuality; +} + +//______________________________________________________________________________ +UInt_t TGLUtil::GetDefaultDrawQuality() +{ + //static: get default draw quality + return fgDefaultDrawQuality; +} + +//______________________________________________________________________________ +void TGLUtil::SetDefaultDrawQuality(UInt_t dq) +{ + //static: set default draw quality + fgDefaultDrawQuality = dq; +} + +//______________________________________________________________________________ +Bool_t TGLUtil::IsColorLocked() +{ + //static: return true if color lockcount is greater than 0 + return fgColorLockCount != 0; +} + //______________________________________________________________________________ void TGLUtil::CheckError(const char * loc) { diff --git a/table/inc/TDataSet.h b/table/inc/TDataSet.h index 3cc5e9a3c38..b62a2ff97a2 100644 --- a/table/inc/TDataSet.h +++ b/table/inc/TDataSet.h @@ -105,7 +105,7 @@ public: virtual TSeqCollection *GetCollection() const { return (TSeqCollection *)fList; } TList *GetList() const { return (TList *)fList; } virtual Int_t GetListSize() const; - static TDataSet *GetMainSet(){ return fgMainSet;} + static TDataSet *GetMainSet(); TObject *GetMother() const { return (TObject*)GetParent();} virtual TObject *GetObject() const; virtual TDataSet *GetParent() const { return fParent;} @@ -148,7 +148,6 @@ public: }; inline void TDataSet::Add(TDataSet *dataset){ AddLast(dataset); } -inline void TDataSet::AddMain(TDataSet *set){ if (fgMainSet && set) fgMainSet->AddFirst(set);} inline TDataSet *TDataSet::At(Int_t idx) const {return fList ? (TDataSet *)fList->At(idx) : 0; } inline Int_t TDataSet::GetListSize() const {return (fList) ? fList->GetSize():0;} inline TDataSet *TDataSet::instance() { return new TDataSet();} diff --git a/table/inc/TDataSetIter.h b/table/inc/TDataSetIter.h index a31c2aad334..706441bb7f7 100644 --- a/table/inc/TDataSetIter.h +++ b/table/inc/TDataSetIter.h @@ -109,7 +109,5 @@ public: ClassDef(TDataSetIter,0) // class-iterator to navigate TDataSet structure }; -inline TDataSet *TDataSetIter::operator *() const { return fDataSet == fgNullDataSet ? fWorkingDataSet : fDataSet; } -inline TDataSet *TDataSetIter::GetNullSet() { return (TDataSet *)fgNullDataSet; } // return a fake pointer == -1 casted to (TDataSet *) #endif diff --git a/table/inc/TIndexTable.h b/table/inc/TIndexTable.h index dddd0cb7e91..ae18c73af4c 100644 --- a/table/inc/TIndexTable.h +++ b/table/inc/TIndexTable.h @@ -69,8 +69,8 @@ protected: // define ClassDefTable(TIndexTable,int) protected: static TTableDescriptor *fgColDescriptors; - virtual TTableDescriptor *GetDescriptorPointer() const { return fgColDescriptors;} - virtual void SetDescriptorPointer(TTableDescriptor *list) { fgColDescriptors = list;} + virtual TTableDescriptor *GetDescriptorPointer() const; + virtual void SetDescriptorPointer(TTableDescriptor *list); public: TIndexTable() : TTable("TIndexTable",sizeof(int)) {SetType("int");} TIndexTable(const Text_t *name) : TTable(name,sizeof(int)) {SetType("int");} diff --git a/table/inc/TTableDescriptor.h b/table/inc/TTableDescriptor.h index 4e1c71b0e0c..0db9ec275a5 100644 --- a/table/inc/TTableDescriptor.h +++ b/table/inc/TTableDescriptor.h @@ -75,8 +75,8 @@ public: // ClassDefTable(TTableDescriptor,tableDescriptor_st) protected: static TTableDescriptor *fgColDescriptors; - virtual TTableDescriptor *GetDescriptorPointer() const { return fgColDescriptors;} - virtual void SetDescriptorPointer(TTableDescriptor *list) { fgColDescriptors = list;} + virtual TTableDescriptor *GetDescriptorPointer() const; + virtual void SetDescriptorPointer(TTableDescriptor *list); public: typedef tableDescriptor_st* iterator; TTableDescriptor() : TTable("TTableDescriptor",sizeof(tableDescriptor_st)), fRowClass(0), fSecondDescriptor(0) {SetType("tableDescriptor_st");} diff --git a/table/src/TDataSet.cxx b/table/src/TDataSet.cxx index 8a0833eaa11..c2f9fb23c3b 100644 --- a/table/src/TDataSet.cxx +++ b/table/src/TDataSet.cxx @@ -389,6 +389,23 @@ TDataSet *TDataSet::First() const if (fList) return (TDataSet *)(fList->First()); return 0; } + +//______________________________________________________________________________ +void TDataSet::AddMain(TDataSet *set) +{ + //add data set to main data set + + if (fgMainSet && set) fgMainSet->AddFirst(set); +} + +//______________________________________________________________________________ +TDataSet *TDataSet::GetMainSet() +{ + //return pointer to the main dataset + + return fgMainSet; +} + //______________________________________________________________________________ TObject *TDataSet::GetObject() const { diff --git a/table/src/TDataSetIter.cxx b/table/src/TDataSetIter.cxx index f70ad0b18bf..540f5a17f7b 100644 --- a/table/src/TDataSetIter.cxx +++ b/table/src/TDataSetIter.cxx @@ -92,6 +92,21 @@ TDataSetIter::~TDataSetIter() fDepth = 0; } + +//______________________________________________________________________________ +TDataSet *TDataSetIter::operator *() const +{ + //operator * + return fDataSet == fgNullDataSet ? fWorkingDataSet : fDataSet; +} + +//______________________________________________________________________________ +TDataSet *TDataSetIter::GetNullSet() +{ + // return a fake pointer == -1 casted to (TDataSet *) + return (TDataSet *)fgNullDataSet; +} + //______________________________________________________________________________ TDataSet *TDataSetIter::Add(TDataSet *set, TDataSet *dataset) { diff --git a/table/src/TIndexTable.cxx b/table/src/TIndexTable.cxx index a3ae9e99b7e..bc1efc71a0b 100644 --- a/table/src/TIndexTable.cxx +++ b/table/src/TIndexTable.cxx @@ -106,6 +106,22 @@ TTableDescriptor *TIndexTable::CreateDescriptor() return fgColDescriptors; } +//___________________________________________________________________ +TTableDescriptor *TIndexTable::GetDescriptorPointer() const +{ + //return column descriptor + return fgColDescriptors; +} + +//___________________________________________________________________ +void TIndexTable::SetDescriptorPointer(TTableDescriptor *list) +{ + //set table descriptor + fgColDescriptors = list; +} + +//___________________________________________________________________ + //___________________________________________________________________ const TTable *TIndexTable::Table() const { diff --git a/table/src/TTableDescriptor.cxx b/table/src/TTableDescriptor.cxx index 555b32d7524..e92361494c3 100644 --- a/table/src/TTableDescriptor.cxx +++ b/table/src/TTableDescriptor.cxx @@ -29,6 +29,21 @@ TTableDescriptor *TTableDescriptor::fgColDescriptors = 0; TString TTableDescriptor::fgCommentsName = ".comments"; TableClassImp(TTableDescriptor,tableDescriptor_st) +//___________________________________________________________________ +TTableDescriptor *TTableDescriptor::GetDescriptorPointer() const +{ + //return column descriptor + return fgColDescriptors; +} + +//___________________________________________________________________ +void TTableDescriptor::SetDescriptorPointer(TTableDescriptor *list) +{ + //set table descriptor + fgColDescriptors = list; +} + + //______________________________________________________________________________ void TTableDescriptor::Streamer(TBuffer &R__b) { diff --git a/vmc/inc/TVirtualMC.h b/vmc/inc/TVirtualMC.h index 6827aedb83d..9d8119cc303 100644 --- a/vmc/inc/TVirtualMC.h +++ b/vmc/inc/TVirtualMC.h @@ -52,7 +52,7 @@ public: virtual ~TVirtualMC(); // Static access method - static TVirtualMC* GetMC() { return fgMC; } + static TVirtualMC* GetMC(); // // ------------------------------------------------ diff --git a/vmc/src/TVirtualMC.cxx b/vmc/src/TVirtualMC.cxx index def7282aa27..d76c1a62e38 100644 --- a/vmc/src/TVirtualMC.cxx +++ b/vmc/src/TVirtualMC.cxx @@ -84,6 +84,14 @@ TVirtualMC::~TVirtualMC() // +//_____________________________________________________________________________ +TVirtualMC *TVirtualMC::GetMC() +{ + //static: return virtual MC object + return fgMC; +} + + //_____________________________________________________________________________ void TVirtualMC::SetStack(TVirtualMCStack* stack) { -- GitLab