From 6d54f886f171562ea77dfffe8fba7ef46a4da9e1 Mon Sep 17 00:00:00 2001 From: elvez Date: Thu, 14 Sep 2006 17:42:15 +0000 Subject: [PATCH] - Fixed portability issues. I'm curious to know where that programmer learnt about 'roundf' and 'uint', anyway... git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1153 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/backend/concrete_process_statistics.cc | 6 +++--- src/backend/concrete_simulation_statistics.cc | 20 +++++++++---------- src/backend/concrete_statistics.cc | 4 ++-- src/backend/concrete_thread_statistics.cc | 6 +++--- src/backend/plugin_manager.cc | 1 + src/backend/sgpemv2/simulation.hh | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/backend/concrete_process_statistics.cc b/src/backend/concrete_process_statistics.cc index 270ea39..78e2747 100644 --- a/src/backend/concrete_process_statistics.cc +++ b/src/backend/concrete_process_statistics.cc @@ -46,7 +46,7 @@ ConcreteProcessStatistics::ConcreteProcessStatistics(const Process* core, const { //retrieve threads statistics necessary to calculate "core"'s statistics vector threads = core->get_threads(); - for (uint i_t = 0; i_t < threads.size(); i_t++) + for (unsigned int i_t = 0; i_t < threads.size(); i_t++) _threads_stats.push_back(ConcreteThreadStatistics(threads[i_t], instant)); @@ -102,7 +102,7 @@ ConcreteProcessStatistics::ConcreteProcessStatistics(const Process* core, const const Environment& env = hist.get_environment_at(time); const vector procs = env.get_processes(); - for (uint i_p=0; i_p < procs.size(); i_p++) + for (unsigned int i_p=0; i_p < procs.size(); i_p++) if (*procs[i_p] == *core && procs[i_p]->get_state() == Schedulable::state_blocked) _resource_waitings_time++; } @@ -201,7 +201,7 @@ vector ConcreteProcessStatistics::get_threads_statistics() const { vector rit; - for (uint i=0; i < _threads_stats.size(); i++) + for (unsigned int i=0; i < _threads_stats.size(); i++) rit.push_back(&_threads_stats[i]); return rit; } diff --git a/src/backend/concrete_simulation_statistics.cc b/src/backend/concrete_simulation_statistics.cc index 76fc620..4c10b90 100644 --- a/src/backend/concrete_simulation_statistics.cc +++ b/src/backend/concrete_simulation_statistics.cc @@ -56,13 +56,13 @@ ConcreteSimulationStatistics::ConcreteSimulationStatistics(const std::vector procs = Simulation::get_instance().get_history().get_environment_at(instant).get_processes(); - for (uint i=0; i < procs.size(); i++) + for (unsigned int i=0; i < procs.size(); i++) { if (procs[i]->get_state() == Schedulable::state_terminated) _terminated_processes++; vector threads = procs[i]->get_threads(); //iterate through all threads of this process - for (uint ii=0; ii < threads.size(); ii++) + for (unsigned int ii=0; ii < threads.size(); ii++) if (threads[ii]->get_state() == Schedulable::state_terminated) _terminated_threads++; } @@ -100,19 +100,19 @@ ConcreteSimulationStatistics::ConcreteSimulationStatistics(const std::vector ConcreteStatistics::get_process_statistics() const { vector rit; - for (uint i=0; i < _proc_stats.size(); i++) + for (unsigned int i=0; i < _proc_stats.size(); i++) rit.push_back(&_proc_stats[i]); return rit; } diff --git a/src/backend/concrete_thread_statistics.cc b/src/backend/concrete_thread_statistics.cc index b3923ab..e12f1d5 100644 --- a/src/backend/concrete_thread_statistics.cc +++ b/src/backend/concrete_thread_statistics.cc @@ -60,11 +60,11 @@ ConcreteThreadStatistics::ConcreteThreadStatistics(const Thread* core, const int const vector procs = env.get_processes(); //looks for the process that owns this thread - for (uint i_p=0; i_p < procs.size(); i_p++) + for (unsigned int i_p=0; i_p < procs.size(); i_p++) { const vector threads = procs[i_p]->get_threads(); //looks for the thread "core" - for (uint i_t = 0; i_t < threads.size(); i_t++) + for (unsigned int i_t = 0; i_t < threads.size(); i_t++) { if ( (*threads[i_t]) == (*core) ) //FOUND!! { @@ -110,7 +110,7 @@ ConcreteThreadStatistics::ConcreteThreadStatistics(const Thread* core, const int { Environment::resource_key_t key = (*res_iter).first; vector req = env.get_request_queue(key); - for (uint i_r=0; i_r < req.size(); i_r++) + for (unsigned int i_r=0; i_r < req.size(); i_r++) if( (*req[i_r]).get_request().get_thread() == (*core) && (*req[i_r]).get_state() == Request::state_allocated) _resource_usage_time++; diff --git a/src/backend/plugin_manager.cc b/src/backend/plugin_manager.cc index 06f13c7..9d19802 100644 --- a/src/backend/plugin_manager.cc +++ b/src/backend/plugin_manager.cc @@ -31,6 +31,7 @@ #include #include +#include using namespace sgpem; using namespace std; diff --git a/src/backend/sgpemv2/simulation.hh b/src/backend/sgpemv2/simulation.hh index 9ad1205..e11b270 100644 --- a/src/backend/sgpemv2/simulation.hh +++ b/src/backend/sgpemv2/simulation.hh @@ -126,7 +126,7 @@ namespace sgpem waiting the time defined with set_timer() between each step, until all processes have terminated, or some error happens. */ - virtual void set_mode(const mode) = 0; + virtual void set_mode(mode) = 0; /** \return The simulation advancement mode: 0 if step-to-step, 1 if