From 16810b0fb09e13cd65d5c344b8708f370281a772 Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Wed, 4 Dec 2002 14:35:13 +0000
Subject: [PATCH] fix in explicit template instantiation syntax which was
 wrong, but accepted by gcc and icc (!). Remove TObjPtr class which is now
 just an instantiation of TObjNum<void*> (for backward compatability we
 provide the typedef: typedef TObjNum<void*> TObjPtr;). Remove reference to
 TObjPtr.h from TBuffer.cxx. To compile make sure to remove
 base/src/G__Base1.d, base/src/G__Base2.d, base/src/G__Base3.d and
 base/src/TBuffer.d.

git-svn-id: http://root.cern.ch/svn/root/trunk@5739 27541ba8-7e3a-0410-8455-c3a389f83636
---
 base/inc/LinkDef3.h  |  4 +++-
 base/inc/TObjNum.h   | 23 +++++++++++----------
 base/inc/TObjPtr.h   | 48 --------------------------------------------
 base/src/TBuffer.cxx |  3 +--
 base/src/TObjNum.cxx | 23 +++++++++++----------
 base/src/TObjPtr.cxx | 33 ------------------------------
 6 files changed, 28 insertions(+), 106 deletions(-)
 delete mode 100644 base/inc/TObjPtr.h
 delete mode 100644 base/src/TObjPtr.cxx

diff --git a/base/inc/LinkDef3.h b/base/inc/LinkDef3.h
index b7cf4c74264..d933ae31964 100644
--- a/base/inc/LinkDef3.h
+++ b/base/inc/LinkDef3.h
@@ -1,4 +1,4 @@
-/* @(#)root/base:$Name:  $:$Id: LinkDef3.h,v 1.7 2002/09/16 10:57:57 rdm Exp $ */
+/* @(#)root/base:$Name:  $:$Id: LinkDef3.h,v 1.8 2002/12/04 12:13:32 rdm Exp $ */
 
 /*************************************************************************
  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
@@ -164,6 +164,7 @@
 #pragma link C++ typedef TObjNumUL;
 #pragma link C++ typedef TObjNumF;
 #pragma link C++ typedef TObjNumD;
+#pragma link C++ typedef TObjPtr;
 
 #pragma link C++ class TObjNum<Char_t>+;
 #pragma link C++ class TObjNum<UChar_t>+;
@@ -175,5 +176,6 @@
 #pragma link C++ class TObjNum<ULong_t>+;
 #pragma link C++ class TObjNum<Float_t>+;
 #pragma link C++ class TObjNum<Double_t>+;
+#pragma link C++ class TObjNum<void*>+;
 
 #endif
diff --git a/base/inc/TObjNum.h b/base/inc/TObjNum.h
index 8bcdcaee585..a24160a3c62 100644
--- a/base/inc/TObjNum.h
+++ b/base/inc/TObjNum.h
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:$:$Id:$
+// @(#)root/base:$Name:  $:$Id: TObjNum.h,v 1.1 2002/12/04 12:13:32 rdm Exp $
 // Author: Fons Rademakers   02/12/02
 
 /*************************************************************************
@@ -60,15 +60,16 @@ public:
    ClassDef(TObjNum,1)  //Basic type wrapped in a TObject
 };
 
-typedef TObjNum<Char_t>   TObjNumC;
-typedef TObjNum<UChar_t>  TObjNumUC;
-typedef TObjNum<Short_t>  TObjNumS;
-typedef TObjNum<UShort_t> TObjNumUS;
-typedef TObjNum<Int_t>    TObjNumI;
-typedef TObjNum<UInt_t>   TObjNumUI;
-typedef TObjNum<Long_t>   TObjNumL;
-typedef TObjNum<ULong_t>  TObjNumUL;
-typedef TObjNum<Float_t>  TObjNumF;
-typedef TObjNum<Double_t> TObjNumD;
+typedef TObjNum<Char_t>      TObjNumC;
+typedef TObjNum<UChar_t>     TObjNumUC;
+typedef TObjNum<Short_t>     TObjNumS;
+typedef TObjNum<UShort_t>    TObjNumUS;
+typedef TObjNum<Int_t>       TObjNumI;
+typedef TObjNum<UInt_t>      TObjNumUI;
+typedef TObjNum<Long_t>      TObjNumL;
+typedef TObjNum<ULong_t>     TObjNumUL;
+typedef TObjNum<Float_t>     TObjNumF;
+typedef TObjNum<Double_t>    TObjNumD;
+typedef TObjNum<void*>       TObjPtr;
 
 #endif
diff --git a/base/inc/TObjPtr.h b/base/inc/TObjPtr.h
deleted file mode 100644
index 6b2f7b147ca..00000000000
--- a/base/inc/TObjPtr.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// @(#)root/base:$Name:  $:$Id: TObjPtr.h,v 1.2 2000/12/13 15:13:45 brun Exp $
-// Author: Fons Rademakers   04/05/96
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-#ifndef ROOT_TObjPtr
-#define ROOT_TObjPtr
-
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// TObjPtr                                                              //
-//                                                                      //
-// Collectable generic pointer class. This is a TObject containing a    //
-// void *.                                                              //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-#ifndef ROOT_TObject
-#include "TObject.h"
-#endif
-
-
-class TObjPtr : public TObject {
-
-private:
-   const void  *fPtr;       //Wrapped pointer
-
-public:
-   TObjPtr(const void *p = 0) : fPtr(p) { }
-   TObjPtr(const TObjPtr &p) : TObject(p),  fPtr(p.fPtr) { }
-   ~TObjPtr() { }
-   Int_t     Compare(const TObject *obj) const;
-   ULong_t   Hash() const { return (ULong_t) fPtr >> 2; }
-   Bool_t    IsSortable() const { return kTRUE; }
-   Bool_t    IsEqual(const TObject *obj) const { return fPtr == obj; }
-   void     *Ptr() const { return (void *)fPtr; }
-
-   //ClassDef(TObjPtr,1)  //Collectable generic pointer class
-};
-
-#endif
diff --git a/base/src/TBuffer.cxx b/base/src/TBuffer.cxx
index 1ed02b86e3c..34d2e739bc8 100644
--- a/base/src/TBuffer.cxx
+++ b/base/src/TBuffer.cxx
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:  $:$Id: TBuffer.cxx,v 1.40 2002/11/15 22:20:51 brun Exp $
+// @(#)root/base:$Name:  $:$Id: TBuffer.cxx,v 1.41 2002/12/02 18:50:01 rdm Exp $
 // Author: Fons Rademakers   04/05/96
 
 /*************************************************************************
@@ -23,7 +23,6 @@
 #include "TFile.h"
 #include "TBuffer.h"
 #include "TExMap.h"
-#include "TObjPtr.h"
 #include "TClass.h"
 #include "TStorage.h"
 #include "TMath.h"
diff --git a/base/src/TObjNum.cxx b/base/src/TObjNum.cxx
index 4e7611c8d81..5f5f142ef05 100644
--- a/base/src/TObjNum.cxx
+++ b/base/src/TObjNum.cxx
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:$:$Id:$
+// @(#)root/base:$Name:  $:$Id: TObjNum.cxx,v 1.1 2002/12/04 12:13:32 rdm Exp $
 // Author: Fons Rademakers   02/12/02
 
 /*************************************************************************
@@ -20,15 +20,16 @@
 #include "TObjNum.h"
 
 // explicit template instantiation of the versions specified in LinkDef.h
-template TObjNum<Char_t>;
-template TObjNum<UChar_t>;
-template TObjNum<Short_t>;
-template TObjNum<UShort_t>;
-template TObjNum<Int_t>;
-template TObjNum<UInt_t>;
-template TObjNum<Long_t>;
-template TObjNum<ULong_t>;
-template TObjNum<Float_t>;
-template TObjNum<Double_t>;
+template class TObjNum<Char_t>;
+template class TObjNum<UChar_t>;
+template class TObjNum<Short_t>;
+template class TObjNum<UShort_t>;
+template class TObjNum<Int_t>;
+template class TObjNum<UInt_t>;
+template class TObjNum<Long_t>;
+template class TObjNum<ULong_t>;
+template class TObjNum<Float_t>;
+template class TObjNum<Double_t>;
+template class TObjNum<void*>;
 
 templateClassImp(TObjNum)
diff --git a/base/src/TObjPtr.cxx b/base/src/TObjPtr.cxx
deleted file mode 100644
index 2fe1c0e98e6..00000000000
--- a/base/src/TObjPtr.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-// @(#)root/base:$Name:  $:$Id: TObjPtr.cxx,v 1.1.1.1 2000/05/16 17:00:39 rdm Exp $
-// Author: Fons Rademakers   04/05/96
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// TObjPtr                                                              //
-//                                                                      //
-// Collectable generic pointer class. This is a TObject containing a    //
-// void *.                                                              //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-#include "TObjPtr.h"
-
-//ClassImp(TObjPtr)
-
-Int_t TObjPtr::Compare(const TObject *obj) const
-{
-   if (fPtr == obj)
-      return 0;
-   else if (fPtr < obj)
-      return -1;
-   else
-      return 1;
-}
-- 
GitLab