From 42d8772dd6a0951dfaf6faa14b58cc7224172cf9 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 21 Sep 2012 12:55:40 +0200 Subject: [PATCH] Avoid signed/unsigned compiler warning. We don't really need a signed int here. --- simgear/structure/subsystem_mgr.cxx | 14 ++++---------- simgear/structure/subsystem_mgr.hxx | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/simgear/structure/subsystem_mgr.cxx b/simgear/structure/subsystem_mgr.cxx index 8a3d6a70..2b29d22d 100644 --- a/simgear/structure/subsystem_mgr.cxx +++ b/simgear/structure/subsystem_mgr.cxx @@ -150,7 +150,7 @@ public: SGSubsystemGroup::SGSubsystemGroup () : _fixedUpdateTime(-1.0), _updateTimeRemainder(0.0), - _initPosition(-1) + _initPosition(0) { } @@ -173,9 +173,6 @@ SGSubsystemGroup::init () SGSubsystem::InitStatus SGSubsystemGroup::incrementalInit() { - if (_initPosition < 0) - _initPosition = 0; - if (_initPosition >= _members.size()) return INIT_DONE; @@ -210,7 +207,7 @@ SGSubsystemGroup::shutdown () // reverse order to prevent order dependency problems for (unsigned int i = _members.size(); i > 0; i--) _members[i-1]->subsystem->shutdown(); - _initPosition = -1; + _initPosition = 0; } void @@ -412,7 +409,7 @@ SGSubsystemGroup::Member::update (double delta_time_sec) SGSubsystemMgr::SGSubsystemMgr () : - _initPosition(-1) + _initPosition(0) { for (int i = 0; i < MAX_GROUPS; i++) { _groups[i] = new SGSubsystemGroup; @@ -440,9 +437,6 @@ SGSubsystemMgr::init () SGSubsystem::InitStatus SGSubsystemMgr::incrementalInit() { - if (_initPosition < 0) - _initPosition = 0; - if (_initPosition >= MAX_GROUPS) return INIT_DONE; @@ -474,7 +468,7 @@ SGSubsystemMgr::shutdown () for (int i = MAX_GROUPS-1; i >= 0; i--) _groups[i]->shutdown(); - _initPosition = -1; + _initPosition = 0; } diff --git a/simgear/structure/subsystem_mgr.hxx b/simgear/structure/subsystem_mgr.hxx index 18684919..37cd8aad 100644 --- a/simgear/structure/subsystem_mgr.hxx +++ b/simgear/structure/subsystem_mgr.hxx @@ -332,7 +332,7 @@ private: double _updateTimeRemainder; /// index of the member we are currently init-ing - int _initPosition; + unsigned int _initPosition; }; @@ -406,7 +406,7 @@ public: private: SGSubsystemGroup* _groups[MAX_GROUPS]; - int _initPosition; + unsigned int _initPosition; typedef std::map SubsystemDict; SubsystemDict _subsystem_map; -- 2.39.2