Fix some warnings

This commit is contained in:
Thomas Geymayer 2013-03-07 00:17:45 +01:00
parent e179bda57a
commit 79ae0da927
5 changed files with 104 additions and 114 deletions

View File

@ -29,8 +29,9 @@ namespace nasal
/**
* Context passed to a function/method being called from Nasal
*/
struct CallContext
class CallContext
{
public:
CallContext(naContext c, size_t argc, naRef* args):
c(c),
argc(argc),
@ -98,8 +99,8 @@ namespace nasal
}
/**
* Get the argument with given index. Raises a Nasal runtime error if there
* are to few arguments available.
* Get the argument with given index. Raises a Nasal runtime error if
* there are to few arguments available.
*/
template<class T>
typename from_nasal_ptr<T>::return_type

View File

@ -22,7 +22,6 @@
using std::istream;
using std::ostream;
/**
* Condition for a single property.
*
@ -162,7 +161,6 @@ SGCondition::~SGCondition ()
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGPropertyCondition.
////////////////////////////////////////////////////////////////////////
@ -178,7 +176,6 @@ SGPropertyCondition::~SGPropertyCondition ()
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGNotCondition.
////////////////////////////////////////////////////////////////////////
@ -199,7 +196,6 @@ SGNotCondition::test () const
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGAndCondition.
////////////////////////////////////////////////////////////////////////
@ -215,8 +211,8 @@ SGAndCondition::~SGAndCondition ()
bool
SGAndCondition::test () const
{
int nConditions = _conditions.size();
for (int i = 0; i < nConditions; i++) {
for( size_t i = 0; i < _conditions.size(); i++ )
{
if (!_conditions[i]->test())
return false;
}
@ -230,7 +226,6 @@ SGAndCondition::addCondition (SGCondition * condition)
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGOrCondition.
////////////////////////////////////////////////////////////////////////
@ -246,8 +241,8 @@ SGOrCondition::~SGOrCondition ()
bool
SGOrCondition::test () const
{
int nConditions = _conditions.size();
for (int i = 0; i < nConditions; i++) {
for( size_t i = 0; i < _conditions.size(); i++ )
{
if (_conditions[i]->test())
return true;
}
@ -261,7 +256,6 @@ SGOrCondition::addCondition (SGCondition * condition)
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGComparisonCondition.
////////////////////////////////////////////////////////////////////////
@ -427,8 +421,7 @@ SGComparisonCondition::setPrecisionDExpression(SGExpressiond* dexp)
{
_precision_property = new SGPropertyNode();
_precision_dexp = dexp;
}
////////////////////////////////////////////////////////////////////////
}////////////////////////////////////////////////////////////////////////
// Read a condition and use it if necessary.
////////////////////////////////////////////////////////////////////////
@ -583,7 +576,6 @@ readCondition( SGPropertyNode *prop_root, const SGPropertyNode *node )
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGConditional.
////////////////////////////////////////////////////////////////////////
@ -610,7 +602,6 @@ SGConditional::test () const
}
// The top-level is always an implicit 'and' group
SGCondition *
sgReadCondition( SGPropertyNode *prop_root, const SGPropertyNode *node )

View File

@ -865,7 +865,7 @@ Expression* logicopParser(const SGPropertyNode* exp, Parser* parser)
ExpParserRegistrar andRegistrar("and", logicopParser<AndExpression>);
ExpParserRegistrar orRegistrar("or", logicopParser<OrExpression>);
int BindingLayout::addBinding(const string& name, Type type)
size_t BindingLayout::addBinding(const string& name, Type type)
{
//XXX error checkint
vector<VariableBinding>::iterator itr
@ -873,7 +873,7 @@ int BindingLayout::addBinding(const string& name, Type type)
boost::bind(&VariableBinding::name, _1) == name);
if (itr != bindings.end())
return itr->location;
int result = bindings.size();
size_t result = bindings.size();
bindings.push_back(VariableBinding(name, type, bindings.size()));
return result;
}

View File

@ -983,7 +983,7 @@ namespace simgear
class BindingLayout
{
public:
int addBinding(const std::string& name, expression::Type type);
size_t addBinding(const std::string& name, expression::Type type);
bool findBinding(const string& name, VariableBinding& result) const;
std::vector<VariableBinding> bindings;
};

View File

@ -117,7 +117,6 @@ void SGSubsystem::stamp(const string& name)
timingInfo.push_back(TimingInfo(name, SGTimeStamp::now()));
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGSubsystemGroup.
////////////////////////////////////////////////////////////////////////
@ -157,7 +156,7 @@ SGSubsystemGroup::SGSubsystemGroup () :
SGSubsystemGroup::~SGSubsystemGroup ()
{
// reverse order to prevent order dependency problems
for (unsigned int i = _members.size(); i > 0; i--)
for( size_t i = _members.size(); i > 0; i-- )
{
delete _members[i-1];
}
@ -166,7 +165,7 @@ SGSubsystemGroup::~SGSubsystemGroup ()
void
SGSubsystemGroup::init ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->init();
}
@ -190,14 +189,14 @@ SGSubsystemGroup::incrementalInit()
void
SGSubsystemGroup::postinit ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->postinit();
}
void
SGSubsystemGroup::reinit ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->reinit();
}
@ -205,7 +204,7 @@ void
SGSubsystemGroup::shutdown ()
{
// reverse order to prevent order dependency problems
for (unsigned int i = _members.size(); i > 0; i--)
for( size_t i = _members.size(); i > 0; i-- )
_members[i-1]->subsystem->shutdown();
_initPosition = 0;
}
@ -213,7 +212,7 @@ SGSubsystemGroup::shutdown ()
void
SGSubsystemGroup::bind ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->bind();
}
@ -221,7 +220,7 @@ void
SGSubsystemGroup::unbind ()
{
// reverse order to prevent order dependency problems
for (unsigned int i = _members.size(); i > 0; i--)
for( size_t i = _members.size(); i > 0; i-- )
_members[i-1]->subsystem->unbind();
}
@ -242,7 +241,7 @@ SGSubsystemGroup::update (double delta_time_sec)
bool recordTime = (reportTimingCb != NULL);
SGTimeStamp timeStamp;
while (loopCount-- > 0) {
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
{
if (recordTime)
timeStamp = SGTimeStamp::now();
@ -261,7 +260,7 @@ SGSubsystemGroup::update (double delta_time_sec)
void
SGSubsystemGroup::reportTiming(void)
{
for (unsigned int i = _members.size(); i > 0; i--)
for( size_t i = _members.size(); i > 0; i-- )
{
_members[i-1]->reportTiming();
}
@ -270,14 +269,14 @@ SGSubsystemGroup::reportTiming(void)
void
SGSubsystemGroup::suspend ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->suspend();
}
void
SGSubsystemGroup::resume ()
{
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
_members[i]->subsystem->resume();
}
@ -285,7 +284,7 @@ string_list
SGSubsystemGroup::member_names() const
{
string_list result;
for (unsigned int i = 0; i < _members.size(); i++)
for( size_t i = 0; i < _members.size(); i++ )
result.push_back( _members[i]->name );
return result;
@ -322,7 +321,7 @@ SGSubsystemGroup::get_subsystem (const string &name)
void
SGSubsystemGroup::remove_subsystem (const string &name)
{
for (unsigned int i = 0; i < _members.size(); i++) {
for( size_t i = 0; i < _members.size(); i++ ) {
if (name == _members[i]->name) {
_members.erase(_members.begin() + i);
return;
@ -345,7 +344,7 @@ SGSubsystemGroup::has_subsystem (const string &name) const
SGSubsystemGroup::Member *
SGSubsystemGroup::get_member (const string &name, bool create)
{
for (unsigned int i = 0; i < _members.size(); i++) {
for( size_t i = 0; i < _members.size(); i++ ) {
if (_members[i]->name == name)
return _members[i];
}
@ -359,7 +358,6 @@ SGSubsystemGroup::get_member (const string &name, bool create)
}
////////////////////////////////////////////////////////////////////////
// Implementation of SGSubsystemGroup::Member
////////////////////////////////////////////////////////////////////////