Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8929)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8930)
@@ -18,4 +18,15 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+
+ 2008/06/09 Thomas Bretz
+
+  * mbase/MArgs.[h,cc]:
+    - for convinience store the full command line as Title
+    - replaced *fArgv by fArgv
+
+  * mbase/MObjLookup.cc:
+    - replaced C-style cast by reinterpret_cast
+
 
 
Index: trunk/MagicSoft/Mars/mbase/MArgs.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 8929)
+++ trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 8930)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz, 7/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2003-2004
+!   Copyright: MAGIC Software Development, 2003-2008
 !
 !
@@ -62,15 +62,17 @@
 MArgs::MArgs(int argc, char **argv, Bool_t root) : fArgc(argc)
 {
+    TString cmdline;
     // FIXME: argv has no const-qualifier to be idetical with
     //        TApplication.
-    fName = argv[0];
-
-    fArgv = new TList;
-    fArgv->SetOwner();
+    fName  = argv[0];
+    fTitle = argv[0];
+
+    fArgv.SetOwner();
 
     for (int i=1; i<argc; i++)
     {
-        MArgsEntry &o = *new MArgsEntry(argv[i]);
-        fArgv->Add(&o);
+        fTitle += " ";
+        fTitle += argv[i];
+        fArgv.Add(new MArgsEntry(argv[i]));
     }
 
@@ -79,13 +81,4 @@
 
     HasOnlyAndRemove("-b");
-}
-
-// --------------------------------------------------------------------------
-//
-// Deletes fArgv.
-//
-MArgs::~MArgs()
-{
-    delete fArgv;
 }
 
@@ -95,14 +88,23 @@
 // Using 'options' as option only 'options' are printed.
 // Using 'arguments' as option only 'arguments' are printed.
+// Using 'cmdline' as option the command line is printed instead of
+//       just the program name
 //
 void MArgs::Print(const Option_t *o) const
 {
-    gLog << all << underline << fName << ":" << endl;
-
-    const TString str(o);
+    TString str(o);
+
+    gLog << all << underline;
+    if (str.Contains("cmdline"))
+        gLog << fTitle << endl;
+    else
+        gLog << fName << ":" << endl;
+
+    str.ReplaceAll("cmdline", "");
+    str.ReplaceAll(" ", "");
 
     if (!str.CompareTo("options", TString::kIgnoreCase))
     {
-        TIter Next(fArgv);
+        TIter Next(&fArgv);
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
@@ -114,5 +116,5 @@
     if (!str.CompareTo("arguments", TString::kIgnoreCase))
     {
-        TIter Next(fArgv);
+        TIter Next(&fArgv);
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
@@ -122,5 +124,5 @@
     }
 
-    fArgv->Print();
+    fArgv.Print();
 }
 
@@ -156,5 +158,5 @@
 TString MArgs::GetString(const TString name) const
 {
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -200,5 +202,5 @@
     const TString name = n.Strip(TString::kBoth);
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -206,5 +208,5 @@
         {
             TString str = s->Data()+s->Index(name)+name.Length();
-            delete fArgv->Remove(dynamic_cast<TObject*>(s));
+            delete fArgv.Remove(dynamic_cast<TObject*>(s));
             return str;
         }
@@ -281,5 +283,5 @@
     Int_t num = 0;
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -303,5 +305,5 @@
     Int_t num = 0;
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -320,5 +322,5 @@
     Int_t num = 0;
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -335,5 +337,5 @@
 Int_t MArgs::GetNumEntries() const
 {
-    return fArgv->GetSize();
+    return fArgv.GetSize();
 }
 
@@ -349,5 +351,5 @@
     const TString name = n.Strip(TString::kBoth);
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -369,5 +371,5 @@
     const TString name = n.Strip(TString::kBoth);
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -391,5 +393,5 @@
     const TString name = n.Strip(TString::kBoth);
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
@@ -417,10 +419,10 @@
     Bool_t rc = kFALSE;
 
-    TIter Next(fArgv);
+    TIter Next(&fArgv);
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
         if (*s==name)
         {
-            delete fArgv->Remove(dynamic_cast<TObject*>(s));
+            delete fArgv.Remove(dynamic_cast<TObject*>(s));
             rc = kTRUE;
         }
Index: trunk/MagicSoft/Mars/mbase/MArgs.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 8929)
+++ trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 8930)
@@ -27,11 +27,11 @@
 {
 private:
-    Int_t  fArgc;
-    TList *fArgv; //->
+    Int_t fArgc; //!
+    TList fArgv; //!
 
 public:
     MArgs(int argc, char **argv, Bool_t root=kFALSE);
-    ~MArgs();
 
+    // TObject
     void Print(const Option_t *o="") const;
 
@@ -39,4 +39,5 @@
     // FIXME: Add default option
 
+    // MArgs
     Int_t    GetInt(const TString name) const;
     Double_t GetFloat(const TString name) const;
Index: trunk/MagicSoft/Mars/mbase/MObjLookup.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MObjLookup.cc	(revision 8929)
+++ trunk/MagicSoft/Mars/mbase/MObjLookup.cc	(revision 8930)
@@ -49,5 +49,5 @@
     while (iter.Next(key, value))
     {
-        TObject *o = (TObject*)value;
+        TObject *o = reinterpret_cast<TObject*>(value);
         if (o->TestBit(kCanDelete) || TestBit(kIsOwner))
             delete o;
@@ -88,5 +88,5 @@
 TObject *MObjLookup::GetObj(Long_t key) const
 {
-    TObject *o = (TObject*)const_cast<TExMap&>(fMap).GetValue(key);
+    TObject *o = reinterpret_cast<TObject*>(const_cast<TExMap&>(fMap).GetValue(key));
     return o ? o : fDefault;
 }
