certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi test/Billard/Billard.cc RTIG/FederationsL...


From: certi-cvs
Subject: [certi-cvs] certi test/Billard/Billard.cc RTIG/FederationsL...
Date: Tue, 29 Apr 2008 08:33:05 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      08/04/29 08:33:05

Modified files:
        test/Billard   : Billard.cc 
        RTIG           : FederationsList.hh RTIG.cc FederationsList.cc 
                         Federation.cc 
        libCERTI       : BasicMessage.hh BasicMessage.cc SocketUDP.cc 

Log message:
        Fix more compiler warnings
        Preliminary fix for 
        bug #23088 : Memory leak in RTIG

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/test/Billard/Billard.cc?cvsroot=certi&r1=3.29&r2=3.30
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.hh?cvsroot=certi&r1=3.40&r2=3.41
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG.cc?cvsroot=certi&r1=3.40&r2=3.41
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.55&r2=3.56
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.83&r2=3.84
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/BasicMessage.hh?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/BasicMessage.cc?cvsroot=certi&r1=3.10&r2=3.11
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUDP.cc?cvsroot=certi&r1=3.17&r2=3.18

Patches:
Index: test/Billard/Billard.cc
===================================================================
RCS file: /sources/certi/certi/test/Billard/Billard.cc,v
retrieving revision 3.29
retrieving revision 3.30
diff -u -b -r3.29 -r3.30
--- test/Billard/Billard.cc     22 Feb 2008 09:56:28 -0000      3.29
+++ test/Billard/Billard.cc     29 Apr 2008 08:33:04 -0000      3.30
@@ -168,7 +168,7 @@
              cout << "Now we test Register Federation Synchronisation Point on 
some federates" << endl ;
              cout << "Please enter a federate handle (zero means none)" << 
endl ;
              cout << "This federate will be synchronized with the creator and 
not the others" << endl;
-             scanf("%d",&numfed) ;
+             std::cin >> numfed;
              if ( numfed != 0 )
                  {
                  // We store numfed into the federate set

Index: RTIG/FederationsList.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.hh,v
retrieving revision 3.40
retrieving revision 3.41
diff -u -b -r3.40 -r3.41
--- RTIG/FederationsList.hh     28 Feb 2008 14:47:59 -0000      3.40
+++ RTIG/FederationsList.hh     29 Apr 2008 08:33:04 -0000      3.41
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: FederationsList.hh,v 3.40 2008/02/28 14:47:59 rousse Exp $
+// $Id: FederationsList.hh,v 3.41 2008/04/29 08:33:04 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_RTIG_FEDERATIONS_LIST_HH
@@ -79,7 +79,7 @@
               bool &is_syncing,
               SocketMC* &comm_mc)
 #else
-        char * info(Handle theHandle,
+        std::string info(Handle theHandle,
                   int &nb_federes,
                   int &nb_regulateurs,
                   bool &is_syncing)
@@ -585,4 +585,4 @@
 
 #endif // _CERTI_RTIG_FEDERATIONS_LIST_HH
 
-// $Id: FederationsList.hh,v 3.40 2008/02/28 14:47:59 rousse Exp $
+// $Id: FederationsList.hh,v 3.41 2008/04/29 08:33:04 erk Exp $

Index: RTIG/RTIG.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.cc,v
retrieving revision 3.40
retrieving revision 3.41
diff -u -b -r3.40 -r3.41
--- RTIG/RTIG.cc        26 Apr 2008 14:59:42 -0000      3.40
+++ RTIG/RTIG.cc        29 Apr 2008 08:33:04 -0000      3.41
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIG.cc,v 3.40 2008/04/26 14:59:42 erk Exp $
+// $Id: RTIG.cc,v 3.41 2008/04/29 08:33:04 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -940,10 +940,9 @@
     catch (NetworkError &e) {
         strcpy(buffer, " - NetworkError");
         auditServer.endLine(rep->exception, buffer);
-
+        delete msg;
         throw e ;
     }
-
     // Default Handler
     catch (Exception &e) {
         D.Out(pdExcept, "Unknown Exception : %s.", e._name);
@@ -961,7 +960,7 @@
     }
 
     auditServer.endLine(rep->exception, buffer);
-
+    delete msg;
     if (link == NULL) return link ;
 
     /* FIXME ***/
@@ -991,4 +990,4 @@
 
 }} // namespace certi/rtig
 
-// $Id: RTIG.cc,v 3.40 2008/04/26 14:59:42 erk Exp $
+// $Id: RTIG.cc,v 3.41 2008/04/29 08:33:04 erk Exp $

Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.55
retrieving revision 3.56
diff -u -b -r3.55 -r3.56
--- RTIG/FederationsList.cc     1 Apr 2008 13:00:47 -0000       3.55
+++ RTIG/FederationsList.cc     29 Apr 2008 08:33:04 -0000      3.56
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: FederationsList.cc,v 3.55 2008/04/01 13:00:47 rousse Exp $
+// $Id: FederationsList.cc,v 3.56 2008/04/29 08:33:04 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -335,15 +335,15 @@
                            bool &is_syncing,
                            SocketMC* &comm_mc)
 #else
-    char * FederationsList::info(Handle handle,
+    std::string FederationsList::info(Handle handle,
                                int &nb_federates,
                                int &nb_regulators,
                                bool &is_syncing)
 #endif
     throw (FederationExecutionDoesNotExist, RTIinternalError)
 {
-    char * FED_Filename = NULL ;
-    Federation *federation ;
+    std::string FED_Filename;
+    Federation *federation = NULL;
     G.Out(pdGendoc,"enter FederationsList::info");
     // It may raise RTIinternalError
     checkHandle(handle);
@@ -355,8 +355,7 @@
     nb_regulators = federation->getNbRegulators();
     is_syncing = federation->isSynchronizing();
     // We need federation FEDid
-    FED_Filename = new char[strlen(federation->getFEDid())+1];
-    strcpy(FED_Filename,federation->getFEDid());
+    FED_Filename = std::string(federation->getFEDid());
 #ifdef FEDERATION_USES_MULTICAST
     comm_mc = federation->MCLink ;
 #endif
@@ -1559,5 +1558,5 @@
 
 }} // certi::rtig
 
-// EOF $Id: FederationsList.cc,v 3.55 2008/04/01 13:00:47 rousse Exp $
+// EOF $Id: FederationsList.cc,v 3.56 2008/04/29 08:33:04 erk Exp $
 

Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.83
retrieving revision 3.84
diff -u -b -r3.83 -r3.84
--- RTIG/Federation.cc  27 Apr 2008 08:37:47 -0000      3.83
+++ RTIG/Federation.cc  29 Apr 2008 08:33:04 -0000      3.84
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: Federation.cc,v 3.83 2008/04/27 08:37:47 erk Exp $
+// $Id: Federation.cc,v 3.84 2008/04/29 08:33:04 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -348,7 +348,7 @@
 
     // Free local allocations
     free(name);
-    free(FEDid);
+    delete[] FEDid;
     delete root ;
 
     delete server ;
@@ -2281,5 +2281,5 @@
 
 }} // namespace certi/rtig
 
-// $Id: Federation.cc,v 3.83 2008/04/27 08:37:47 erk Exp $
+// $Id: Federation.cc,v 3.84 2008/04/29 08:33:04 erk Exp $
 

Index: libCERTI/BasicMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/BasicMessage.hh,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- libCERTI/BasicMessage.hh    26 Apr 2008 14:59:41 -0000      3.8
+++ libCERTI/BasicMessage.hh    29 Apr 2008 08:33:05 -0000      3.9
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: BasicMessage.hh,v 3.8 2008/04/26 14:59:41 erk Exp $
+// $Id: BasicMessage.hh,v 3.9 2008/04/29 08:33:05 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef LIBCERTI_BASIC_MESSAGE
@@ -50,6 +50,7 @@
     const std::vector<RegionHandle> &getRegions() const ;
         
 protected:
+       virtual ~BasicMessage();
        virtual void serialize(MessageBuffer& msgBuffer);
        virtual void deserialize(MessageBuffer& msgBuffer);
        
@@ -74,4 +75,4 @@
 
 #endif // LIBCERTI_BASIC_MESSAGE
 
-// $Id: BasicMessage.hh,v 3.8 2008/04/26 14:59:41 erk Exp $
+// $Id: BasicMessage.hh,v 3.9 2008/04/29 08:33:05 erk Exp $

Index: libCERTI/BasicMessage.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/BasicMessage.cc,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -b -r3.10 -r3.11
--- libCERTI/BasicMessage.cc    26 Apr 2008 14:59:40 -0000      3.10
+++ libCERTI/BasicMessage.cc    29 Apr 2008 08:33:05 -0000      3.11
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: BasicMessage.cc,v 3.10 2008/04/26 14:59:40 erk Exp $
+// $Id: BasicMessage.cc,v 3.11 2008/04/29 08:33:05 erk Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -35,6 +35,10 @@
 
 namespace certi {
 
+BasicMessage::~BasicMessage() {
+       
+}
+
 // ----------------------------------------------------------------------------
 /** Set extents
  */
@@ -221,4 +225,4 @@
 
 } // namespace certi
 
-// $Id: BasicMessage.cc,v 3.10 2008/04/26 14:59:40 erk Exp $
+// $Id: BasicMessage.cc,v 3.11 2008/04/29 08:33:05 erk Exp $

Index: libCERTI/SocketUDP.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUDP.cc,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -b -r3.17 -r3.18
--- libCERTI/SocketUDP.cc       9 Dec 2007 16:46:50 -0000       3.17
+++ libCERTI/SocketUDP.cc       29 Apr 2008 08:33:05 -0000      3.18
@@ -192,13 +192,13 @@
 if (!open()) 
        {
        perror("SocketUDP: Open");
-       throw NetworkError("");
+       throw NetworkError("Cannot open UDP Socket");
        }
 
 if (!bind()) 
        {
        perror("SocketUDP: Bind");
-       throw NetworkError("");
+       throw NetworkError("Cannot bind UDP Socket");
        }
 
 _est_init_udp = true ;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]