diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-05-27 16:35:11 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-05-27 16:35:11 +0000 |
commit | 632be79b28291e58aee0d577dc03003531719fb8 (patch) | |
tree | 8031d47e6d780d570c0568871150be094308deb6 | |
parent | 10c19e42106a6d0aefcedf11d283050951ccef1c (diff) | |
download | ATCD-632be79b28291e58aee0d577dc03003531719fb8.tar.gz |
Fixed portability issues and MSVC warnings
18 files changed, 176 insertions, 166 deletions
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.cpp index a9702009de5..e815edc7a51 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.cpp @@ -1,9 +1,7 @@ -#include <unistd.h> -#include <stdlib.h> -#include <iostream> +#include "AppOptions.h" + #include <sstream> -#include "AppOptions.h" #include "ace/Global_Macros.h" #include "ace/Guard_T.h" #include "ace/Log_Msg.h" @@ -11,7 +9,7 @@ /// Initialize the static data member. AppOptions * volatile AppOptions::instance_ = 0; -std::auto_ptr <AppOptions> AppOptions::deleter_; +ACE_Auto_Ptr<AppOptions> AppOptions::deleter_; ACE_Thread_Mutex AppOptions::lock_; AppOptions::AppOptions (void) @@ -30,12 +28,14 @@ AppOptions *AppOptions::instance (void) if (! instance_) { ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock_, 0); + if (! instance_) { instance_ = new AppOptions (); deleter_.reset (instance_); } } + return instance_; } @@ -106,7 +106,7 @@ std::string AppOptions::host_monitor_ior () const return host_monitor_ior_; } -size_t AppOptions::get_port () const +u_short AppOptions::get_port () const { return port_; } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.h index a1c061f6e8c..aa89b3a278b 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppOptions.h @@ -8,9 +8,11 @@ #ifndef _APPOPTIONS_H #define _APPOPTIONS_H -#include <iostream> #include <string> + #include "ace/Thread_Mutex.h" +#include "ace/Auto_Ptr.h" + #include "ArgPair.h" /** @@ -31,13 +33,13 @@ public: /// Parse command-line arguments and set the appropriate values as /// follows: bool parse_args (int argc, char **argv); - std::string host_id () const; - std::string host_monitor_ior () const; - size_t get_port () const; - std::string ior_output_file () const; - std::string object_info_file () const; - std::string process_id () const; - ArgPair arg_pair () const; + std::string host_id (void) const; + std::string host_monitor_ior (void) const; + u_short get_port (void) const; + std::string ior_output_file (void) const; + std::string object_info_file (void) const; + std::string process_id (void) const; + ArgPair arg_pair (void) const; protected: @@ -47,7 +49,7 @@ protected: std::string host_monitor_ior_; std::string host_id_; - size_t port_; + u_short port_; std::string ior_output_file_; std::string object_info_file_; std::string process_id_; @@ -55,7 +57,7 @@ protected: /// Singleton instance. static AppOptions * volatile instance_; - static std::auto_ptr<AppOptions> deleter_; + static ACE_Auto_Ptr<AppOptions> deleter_; static ACE_Thread_Mutex lock_; }; diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.cpp index df4059ab5ae..3d8a1206a02 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.cpp @@ -20,7 +20,7 @@ AppSideMonitor_Thread::AppSideMonitor_Thread (ACE_Barrier *thread_barrier) int AppSideMonitor_Thread::svc (void) { - if (serv_addr_.set (this->port_, INADDR_ANY) == -1) + if (serv_addr_.set (this->port_) == -1) { ACE_DEBUG ((LM_ERROR, "Can't set port.\n")); return EXIT_FAILURE; diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.h index d8c30519b4f..d1557bde8eb 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideMonitor_Thread.h @@ -32,7 +32,7 @@ public: virtual int svc (void); private: - size_t port_; + u_short port_; ACE_SOCK_Acceptor::PEER_ADDR serv_addr_; ACE_Reactor reactor_; ACE_Acceptor <AppSideMonitor_Handler, ACE_SOCK_Acceptor> acceptor_; diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideReg.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideReg.cpp index d2f9bc3fca4..33095976b95 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideReg.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/AppSideReg.cpp @@ -72,32 +72,39 @@ int AppSideReg::svc(void) //ACE_DEBUG ((LM_DEBUG, "Monitor activated\n")); - internal_thread_barrier.wait (); + internal_thread_barrier.wait (); + /// Waiting for the AppSideMonitor_Thread to finish its socket stuff. - try { + try + { hmvar_->dump (); - } catch (CORBA::Exception & ex) { - ACE_DEBUG((LM_DEBUG,"exception from dump.\n")); + } + catch (CORBA::Exception &) + { + ACE_DEBUG ((LM_DEBUG,"exception from dump.\n")); throw; } - //ACE_DEBUG ((LM_DEBUG, "Registering process\n")); - try { - if (hmvar_->register_process ( - AppOptions::instance()->process_id().c_str(), - AppOptions::instance()->host_id().c_str(), - AppOptions::instance()->get_port())) + try + { + if (hmvar_->register_process ( + AppOptions::instance ()->process_id ().c_str (), + AppOptions::instance ()->host_id ().c_str (), + AppOptions::instance ()->get_port ())) { - ACE_DEBUG((LM_DEBUG, "Registered successfully %s with host monitor.\n", - AppOptions::instance()->process_id().c_str())); + ACE_DEBUG ((LM_DEBUG, + "Registered successfully %s with host monitor.\n", + AppOptions::instance()->process_id().c_str())); } - else + else { - ACE_DEBUG((LM_ERROR, "Registeration with the monitor failed.\n")); + ACE_DEBUG ((LM_ERROR, "Registeration with the monitor failed.\n")); } - } catch (CORBA::Exception & ex) { - ACE_DEBUG((LM_DEBUG,"exception from register_process.\n")); + } + catch (CORBA::Exception &) + { + ACE_DEBUG ((LM_DEBUG,"exception from register_process.\n")); throw; } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp index 3645ca79367..1a46269e58a 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp @@ -1,19 +1,19 @@ -#include <algorithm> - #include "ArgPair.h" +#include <algorithm> + ArgPair::ArgPair (int c, char **v) : argc (c), argv (new char *[c]) { - std::copy (v, v + c, this->argv); + (void) std::copy (v, v + c, this->argv); } ArgPair::ArgPair (const ArgPair &ap) : argc (ap.argc), argv (new char *[ap.argc]) { - std::copy (ap.argv, ap.argv + ap.argc, this->argv); + (void) std::copy (ap.argv, ap.argv + ap.argc, this->argv); } ArgPair & ArgPair::operator = (const ArgPair &ap) diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.h index 873316b3531..3f04c9944af 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.h @@ -4,7 +4,7 @@ struct ArgPair { ArgPair (int argc, char **argv); - ~ArgPair (); + ~ArgPair (void); ArgPair (const ArgPair &); ArgPair & operator = (const ArgPair &); void swap (ArgPair &); diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.cpp index f7c7cd42eda..b053c58e6b3 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.cpp @@ -1,10 +1,9 @@ -#include <unistd.h> -#include <stdlib.h> -#include <iostream> -#include <sstream> -#include <algorithm> #include "HMOptions.h" + +#include <sstream> + #include "ArgPair.h" + #include "ace/Global_Macros.h" #include "ace/Guard_T.h" #include "ace/Log_Msg.h" @@ -12,10 +11,9 @@ /// Initialize the static data member. HMOptions * volatile HMOptions::instance_ = 0; -std::auto_ptr <HMOptions> HMOptions::deleter_; +ACE_Auto_Ptr<HMOptions> HMOptions::deleter_; ACE_Thread_Mutex HMOptions::lock_; - HMOptions::HMOptions (void) : RM_ior_ ("file://rm.ior"), arg_pair_ (0,0), diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.h index 3298cf40179..e549331017c 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HMOptions.h @@ -8,10 +8,10 @@ #ifndef _HMOPTIONS_H #define _HMOPTIONS_H -#include <iostream> #include <string> -#include "ace/Thread_Mutex.h" +#include "ace/Thread_Mutex.h" +#include "ace/Auto_Ptr.h" /** * @class HMOptions @@ -33,13 +33,13 @@ public: /// Parse command-line arguments and set the appropriate values as /// follows: bool parse_args (int argc, char **argv); - std::string RM_ior () const; - std::string HM_ior_file () const; - std::string host_id () const; - int RM_update_freq () const; - int load_monitor_freq () const; - std::string util_file () const; - ArgPair arg_pair (); + std::string RM_ior (void) const; + std::string HM_ior_file (void) const; + std::string host_id (void) const; + int RM_update_freq (void) const; + int load_monitor_freq (void) const; + std::string util_file (void) const; + ArgPair arg_pair (void); std::pair <char, std::string> ior_access () const; @@ -59,9 +59,9 @@ protected: /// Singleton instance. static HMOptions * volatile instance_; - static std::auto_ptr<HMOptions> deleter_; + static ACE_Auto_Ptr<HMOptions> deleter_; static ACE_Thread_Mutex lock_; }; -#endif /* _APPOPTIONS_H */ +#endif /* _HMOPTIONS_H */ diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HostMonitorImpl.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HostMonitorImpl.cpp index 2850a09780f..6e152b2e4cb 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/HostMonitorImpl.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/HostMonitorImpl.cpp @@ -4,7 +4,6 @@ #include "RM_Proxy.h" #include "HMOptions.h" #include "LinuxCPULoadCalculator.h" -#include "FCS_Monitor_Adapter.h" #include "Utilization_Monitor.h" #include "ace/Connector.h" diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/LWFT.mpc b/TAO/orbsvcs/examples/FaultTolerance/FLARe/LWFT.mpc index 92de9417cdb..27c3ed7432f 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/LWFT.mpc +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/LWFT.mpc @@ -6,126 +6,124 @@ project(*idl): taoidldefaults { LWFT.idl monitor.idl } + IDL_Files { idlflags += -SS ObjectReferenceFactory.idl } + custom_only = 1 } -project(*server2): rt_server, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, objreftemplate, pi_server, interceptors, naming, pi, iorinterceptor { +project(*server2): rt_server, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, pi_server, interceptors, naming, iorinterceptor { after += *idl exename = server-2 + + IDL_Files { + } + Source_Files { - server-2.cpp - Hello.cpp - ObjectReferenceFactory.cpp - ServerORBInitializer.cpp - IOR_Interceptor.cpp + AppOptions.cpp + ArgPair.cpp AppSideMonitor_Thread.cpp AppSideMonitor_Handler.cpp AppSideReg.cpp - AppOptions.cpp - ArgPair.cpp - LWFTC.cpp - LWFTS.cpp - } - Source_Files { + Hello.cpp + IOR_Interceptor.cpp LWFTC.cpp LWFTS.cpp - ObjectReferenceFactoryC.cpp monitorC.cpp monitorS.cpp + ObjectReferenceFactory.cpp + ObjectReferenceFactoryC.cpp + server-2.cpp + ServerORBInitializer.cpp } } -project(*server1): rt_server, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, objreftemplate, pi_server, interceptors, naming, pi, iorinterceptor { +project(*server1): rt_server, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, pi_server, interceptors, naming, iorinterceptor { after += *idl exename = server-1 + + IDL_Files { + } + Source_Files { - server-1.cpp - Hello.cpp - ObjectReferenceFactory.cpp - ServerORBInitializer.cpp - IOR_Interceptor.cpp + AppOptions.cpp + ArgPair.cpp AppSideMonitor_Thread.cpp AppSideMonitor_Handler.cpp AppSideReg.cpp - AppOptions.cpp - ArgPair.cpp - LWFTC.cpp - LWFTS.cpp - } - Source_Files { + Hello.cpp + IOR_Interceptor.cpp LWFTC.cpp LWFTS.cpp - ObjectReferenceFactoryC.cpp monitorC.cpp monitorS.cpp + ObjectReferenceFactory.cpp + ObjectReferenceFactoryC.cpp + server-1.cpp + ServerORBInitializer.cpp } } -project(*client): rt_client, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, pi, pi_server, interceptors, naming { +project(*client): rt_client, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, pi_server, interceptors, naming { after += *idl exename = client + + IDL_Files { + } + Source_Files { - LWFTC.cpp - LWFTS.cpp - Client_ORBInitializer.cpp - Client_Request_Interceptor.cpp Agent.cpp client.cpp - } - Source_Files { + Client_ORBInitializer.cpp + Client_Request_Interceptor.cpp LWFTC.cpp LWFTS.cpp } - IDL_Files { - } } -project(*HostMonitor): taoserver, portableserver, naming { +project(*HostMonitor): taoserver, naming { after += *idl exename = host_monitor + + IDL_Files { + } + Source_Files { + ArgPair.cpp + Failure_Handler.cpp + HMOptions.cpp host_monitor.cpp HostMonitorImpl.cpp LinuxCPULoadCalculator.cpp - Failure_Handler.cpp - Monitor_Thread.cpp - RM_Proxy.cpp - Utilization_Monitor.cpp - Timer.cpp - HMOptions.cpp - ArgPair.cpp - LWFTC.cpp - LWFTS.cpp - } - Source_Files { LWFTC.cpp LWFTS.cpp + Monitor_Thread.cpp monitorC.cpp monitorS.cpp + RM_Proxy.cpp + Timer.cpp + Utilization_Monitor.cpp } } -project(*ReplicationManager): taoclient, taoserver, naming { +project(*ReplicationManager): taoserver, naming { after += *idl exename = ReplicationManager - Source_Files { - ReplicationManager.cpp - Timer.cpp - ReplicationManager_process.cpp - RMOptions.cpp - ArgPair.cpp + + IDL_Files { } + Source_Files { + ArgPair.cpp LWFTC.cpp LWFTS.cpp - RMOptions.h - ArgPair.h - } - IDL_Files { + ReplicationManager.cpp + ReplicationManager_process.cpp + RMOptions.cpp + Timer.cpp } } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.cpp index 4f4f3f89bdb..77954c6721e 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.cpp @@ -1,10 +1,9 @@ -#include <unistd.h> -#include <stdlib.h> -#include <iostream> -#include <sstream> -#include <algorithm> #include "RMOptions.h" + +#include <sstream> + #include "ArgPair.h" + #include "ace/Global_Macros.h" #include "ace/Guard_T.h" #include "ace/Log_Msg.h" @@ -12,13 +11,12 @@ /// Initialize the static data member. RMOptions * volatile RMOptions::instance_ = 0; -std::auto_ptr <RMOptions> RMOptions::deleter_; +ACE_Auto_Ptr<RMOptions> RMOptions::deleter_; ACE_Thread_Mutex RMOptions::lock_; - RMOptions::RMOptions (void) - : hertz_(0.2), - proactive_(true), + : hertz_ (0.2), + proactive_ (true), arg_pair_ (0,0) { } @@ -28,12 +26,14 @@ RMOptions *RMOptions::instance (void) if (! instance_) { ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock_, 0); + if (! instance_) { instance_ = new RMOptions (); deleter_.reset (instance_); } } + return instance_; } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.h index 634e0cd7ab8..d1ab360cd26 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/RMOptions.h @@ -5,13 +5,13 @@ * */ -#ifndef _HMOPTIONS_H -#define _HMOPTIONS_H +#ifndef _RMOPTIONS_H +#define _RMOPTIONS_H -#include <iostream> #include <string> -#include "ace/Thread_Mutex.h" +#include "ace/Thread_Mutex.h" +#include "ace/Auto_Ptr.h" /** * @class RMOptions @@ -33,8 +33,8 @@ public: /// Parse command-line arguments and set the appropriate values as /// follows: bool parse_args (int argc, char **argv); - bool proactive () const; - double hertz() const; + bool proactive (void) const; + double hertz (void) const; protected: @@ -47,9 +47,9 @@ protected: /// Singleton instance. static RMOptions * volatile instance_; - static std::auto_ptr<RMOptions> deleter_; + static ACE_Auto_Ptr<RMOptions> deleter_; static ACE_Thread_Mutex lock_; }; -#endif /* _APPOPTIONS_H */ +#endif /* _RMOPTIONS_H */ diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.cpp index b7127166c95..1eb1998732a 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.cpp @@ -1,6 +1,9 @@ // cvs-id : $Id$ #include "ReplicationManager.h" + +#include <string> + #include "LWFTC.h" template <class T> @@ -90,13 +93,12 @@ operator = (APP_INFO const & app_info) } bool -APP_INFO:: -operator == (APP_INFO const & app_info) +operator == (APP_INFO const & lhs, APP_INFO const & rhs) { - return ((object_id == app_info.object_id) && - (host_name == app_info.host_name) && - (process_id == app_info.process_id) && - (role == app_info.role)); + return ((lhs.object_id == rhs.object_id) && + (lhs.host_name == rhs.host_name) && + (lhs.process_id == rhs.process_id) && + (lhs.role == rhs.role)); } class Algorithm : public ACE_Task_Base @@ -194,6 +196,7 @@ update_appset_map (const char * key_str, { APP_SET app_set; ACE_CString key (key_str); + if (map.find (key, app_set) != 0) // if not present { app_set.insert_tail (app_info); @@ -678,29 +681,33 @@ send_rank_list() { agent->update_rank_list(this->rank_list_); } - catch (CORBA::SystemException & e) + catch (CORBA::SystemException &) { - ACE_DEBUG((LM_DEBUG,"An agent died.\n")); + ACE_DEBUG ((LM_DEBUG,"An agent died.\n")); } } } -void ReplicationManager_i:: -update_ior_map (ACE_CString const & oid, - std::priority_queue<UtilRank> const & rl) +void ReplicationManager_i::update_ior_map ( + ACE_CString const & oid, + std::priority_queue<UtilRank> const & rl) { std::priority_queue <UtilRank> rank_list (rl); APP_SET app_set; ACE_Guard <ACE_Recursive_Thread_Mutex> guard (this->appset_lock_); - if (objectid_appset_map_.find(oid, app_set) == 0) // if present + + if (objectid_appset_map_.find (oid, app_set) == 0) // if present { RANKED_IOR_LIST ranked_ior_list; - while (!rank_list.empty()) + + while (!rank_list.empty ()) { - UtilRank ur = rank_list.top(); - rank_list.pop(); + UtilRank ur = rank_list.top (); + rank_list.pop (); + for (APP_SET::iterator as_iter = app_set.begin(); - as_iter != app_set.end(); ++as_iter) + as_iter != app_set.end(); + ++as_iter) { if (ur.host_id == (*as_iter).host_name.c_str()) { @@ -713,6 +720,7 @@ update_ior_map (ACE_CString const & oid, } } RANKED_IOR_LIST temp_ior_list; + if (objectid_rankedior_map_.find (oid, temp_ior_list) != 0) // if not present objectid_rankedior_map_.bind (oid, ranked_ior_list); else @@ -720,7 +728,7 @@ update_ior_map (ACE_CString const & oid, } else { - ACE_DEBUG((LM_ERROR, "Objectid=%s not present in APP_SET\n",oid.c_str())); + ACE_DEBUG ((LM_ERROR, "Objectid=%s not present in APP_SET\n",oid.c_str())); } } diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.h index d3d3c53bd1d..b61659ae65a 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ReplicationManager.h @@ -29,9 +29,7 @@ struct APP_INFO Role role; CORBA::Object_var ior; -public: - - APP_INFO(); + APP_INFO (void); APP_INFO (APP_INFO const & app_info); APP_INFO (const char *oid, double l, const char *hname, const char *pid, Role r, CORBA::Object_ptr ref); @@ -39,16 +37,17 @@ public: const char *pid, Role r); void swap (APP_INFO & app_info); APP_INFO & operator = (APP_INFO const & app_info); - bool operator == (APP_INFO const & app_info); }; +bool operator == (APP_INFO const & lhs, APP_INFO const & rhs); + struct RANKED_IOR_LIST { bool now; std::list<CORBA::Object_var> ior_list; std::list<ACE_CString> host_list; - RANKED_IOR_LIST(); + RANKED_IOR_LIST (void); }; struct UtilRank diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.cpp index acc801242eb..2fdd7c2b916 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.cpp @@ -1,5 +1,6 @@ #include "Timer.h" + #include "ace/Timer_Queue.h" #include "ace/Reactor.h" @@ -18,7 +19,7 @@ Timer::Timer (void) } // destructor -Timer::~Timer () +Timer::~Timer (void) { delete this->reactor (); this->reactor (0); @@ -26,7 +27,7 @@ Timer::~Timer () // get our attribute double -Timer::hertz () +Timer::hertz (void) { return this->hertz_; } @@ -40,7 +41,7 @@ Timer::hertz (double h) // start the timer void -Timer::start () +Timer::start (void) { // we are using this step in case we want to restart the timer capabilities // again @@ -68,7 +69,7 @@ Timer::start () // we are now active this->active_ = 1; - long int interval = 1000000 / hertz_; + long interval = static_cast<long> (1000000 / this->hertz_); // start a periodic timer this->tid_ = this->reactor ()->schedule_timer (this, @@ -89,7 +90,7 @@ Timer::start () // stopping the timer void -Timer::stop () +Timer::stop (void) { if (this->active_ == 0) { // Not valid. ACE_ERROR ((LM_ERROR, diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.h index 37a28c08c3f..51a6e015a61 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.h +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Timer.h @@ -27,8 +27,8 @@ public: double hertz (void); void hertz (double h); - void start (); - void stop (); + void start (void); + void stop (void); /// Helper function to be called back after a timeout virtual int pulse (void); @@ -58,9 +58,6 @@ protected: /// The timer id we are waiting. long tid_; - }; - - #endif /* TIMER_H */ diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/client.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/client.cpp index e9e1ac92829..afc387d4d9f 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/FLARe/client.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/client.cpp @@ -818,7 +818,8 @@ Paced_Worker::svc (void) ACE_hrtime_t time_after_call = ACE_OS::gethrtime (); this->history_.sample (time_after_call - time_before_call); - sample_vector[count++] = ((time_after_call - time_before_call) / gsf); + sample_vector[count++] = + static_cast<int> ((time_after_call - time_before_call) / gsf); if (time_after_call > deadline_for_current_call) { |