Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2008, 11:44:20 AM (16 years ago)
Author:
rgrieder
Message:
  • Updated msvc files
  • Changed iterator to const_iterator for stl iterator in constant member functions (msvc reports a build error otherwise)
  • Added linkage again to BLANKSTRING: The whole idea about it was to give "" an address in the memory so we can return that address. static const variables however don't have a linkage and therefore no address, so it's equivalent to writing "". Fortunately, at least msvc (gcc too I guess) is clever enough to artificially create a real symbol, so it did work without the linkage.
Location:
code/branches/objecthierarchy/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/gametypes/Gametype.cc

    r2019 r2020  
    143143            unsigned int randomspawn = (unsigned int)rnd(this->spawnpoints_.size());
    144144            unsigned int index = 0;
    145             for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
     145            for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
    146146            {
    147147                if (index == randomspawn)
     
    156156    void Gametype::assignDefaultPawnsIfNeeded() const
    157157    {
    158         for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     158        for (std::set<PlayerInfo*>::const_iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    159159        {
    160160            if (!(*it)->getControllableEntity() && (!(*it)->isReadyToSpawn() || !this->bStarted_))
  • code/branches/objecthierarchy/src/util/String.cc

    r2019 r2020  
    3939#include "Convert.h"
    4040#include "Math.h"
     41
     42std::string BLANKSTRING("");
    4143
    4244std::string getUniqueNumberString()
  • code/branches/objecthierarchy/src/util/String.h

    r2019 r2020  
    4040#include <sstream>
    4141
    42 _UtilExport static const std::string BLANKSTRING = "";
     42extern _UtilExport std::string BLANKSTRING;
    4343_UtilExport std::string getUniqueNumberString();
    4444
Note: See TracChangeset for help on using the changeset viewer.