Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5313 in orxonox.OLD for trunk/src/util/track


Ignore:
Timestamp:
Oct 8, 2005, 2:07:42 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor nicessity fixes. no real bugs traced → :(

Location:
trunk/src/util/track
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/track/track_manager.cc

    r5129 r5313  
    105105      tIterator<TrackElement>* iterator = this->children->getIterator();
    106106      TrackElement* enumElem = iterator->firstElement();
    107       TrackElement* tmpElem;
     107      TrackElement* tmpElem = NULL;
    108108      while (enumElem)
    109109        {
    110           if ((tmpElem = enumElem->findByID(trackID)))
     110          if ((tmpElem = enumElem->findByID(trackID)) != NULL)
    111111            return tmpElem;
    112112          enumElem = iterator->nextElement();
     
    196196   Be aware, that when the trackElement has no Children, NULL will be returned
    197197*/
    198 TrackElement* TrackElement::getChild(int childCount) const
     198TrackElement* TrackElement::getChild(unsigned int childCount) const
    199199{
    200200  // if the the trackElement has no children return NULL.
     
    207207  tIterator<TrackElement>* iterator = this->children->getIterator();
    208208  TrackElement* enumElem = iterator->firstElement();
    209   for (int i = 0; i < childCount; i++)
     209  for (unsigned int i = 0; i < childCount; i++)
    210210    enumElem = iterator->nextElement();
    211211  delete iterator;
     
    881881  this->joinV(strings.getCount(), trackIDs);
    882882
    883   for(int i = 0; i < strings.getCount(); i++)
     883  for(unsigned int i = 0; i < strings.getCount(); i++)
    884884    {
    885885      TrackElement* tmpElem = this->firstTrackElem->findByName(strings.getString(i));
    886       if (tmpElem)
     886      if (tmpElem != NULL)
    887887        trackIDs[i] = tmpElem->ID;
    888888      else
     889      {
    889890        PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", strings.getString(i));
    890     }
    891 
     891        trackIDs[i] = -1;
     892      }
     893    }
    892894  this->joinV(strings.getCount(), trackIDs);
    893895  delete []trackIDs;
     
    905907  TrackElement* tmpTrackElem;
    906908  TrackElement* tmpJoinElem;
    907   for (int i = 0; i < count; i++)
     909  for (unsigned int i = 0; i < count; i++)
    908910    if (!this->firstTrackElem->findByID(trackIDs[i]))
    909911      {
     
    934936    this->setSavePoint(firstJoint);
    935937  // Timing:
    936   for (int i = 0; i < count; i++)
     938  for (unsigned int i = 0; i < count; i++)
    937939    {
    938940      if(tmpJoinElem = this->firstTrackElem->findByID(trackIDs[i]))
  • trunk/src/util/track/track_manager.h

    r5014 r5313  
    5050  bool backLoopCheck() const;
    5151
    52   TrackElement* getChild(int childNumber) const;
     52  TrackElement* getChild(unsigned int childNumber) const;
    5353
    5454 private:
Note: See TracChangeset for help on using the changeset viewer.