Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (14 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
Location:
code/branches/presentation2/src/libraries/network
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/network/Client.cc

    r6387 r6394  
    139139    {
    140140      timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
    141       //     COUT(3) << ".";
     141      //     COUT(3) << '.';
    142142      if ( isConnected() && isSynched_ )
    143143      {
  • code/branches/presentation2/src/libraries/network/GamestateClient.cc

    r6387 r6394  
    137137    COUT(4) << "gamestates: ";
    138138    for(it=gamestateMap_.begin(); it!=gamestateMap_.end(); it++){
    139       COUT(4) << it->first << ":" << it->second << "|";
     139      COUT(4) << it->first << ':' << it->second << '|';
    140140    }
    141141    COUT(4) << std::endl;
  • code/branches/presentation2/src/libraries/network/packet/ClassID.cc

    r5929 r6394  
    4848ClassID::ClassID( ) : Packet(){
    4949  Identifier *id;
    50   std::string classname;
    5150  unsigned int nrOfClasses=0;
    5251  unsigned int packetSize=2*sizeof(uint32_t); //space for the packetID and for the nrofclasses
     
    6160    if(id == NULL || !id->hasFactory())
    6261      continue;
    63     classname = id->getName();
     62    const std::string& classname = id->getName();
    6463    network_id = id->getNetworkID();
    6564    // now push the network id and the classname to the stack
  • code/branches/presentation2/src/libraries/network/packet/DeleteObjects.cc

    r6387 r6394  
    7272    unsigned int temp = Synchronisable::popDeletedObject();
    7373    *reinterpret_cast<uint32_t*>(tdata) = temp;
    74     COUT(4) << temp << " ";
     74    COUT(4) << temp << ' ';
    7575    tdata += sizeof(uint32_t);
    7676  }
  • code/branches/presentation2/src/libraries/network/packet/FunctionIDs.cc

    r6388 r6394  
    4747
    4848FunctionIDs::FunctionIDs( ) : Packet(){
    49   std::string functionname;
    5049  unsigned int nrOfFunctions=0;
    5150  unsigned int packetSize=2*sizeof(uint32_t); //space for the packetID and for the nroffunctions
     
    5756  ObjectList<NetworkFunctionBase>::iterator it;
    5857  for(it = ObjectList<NetworkFunctionBase>::begin(); it; ++it){
    59     functionname = it->getName();
     58    const std::string& functionname = it->getName();
    6059    networkID = it->getNetworkID();
    6160    // now push the network id and the classname to the stack
  • code/branches/presentation2/src/libraries/network/packet/Gamestate.cc

    r6388 r6394  
    529529//   COUT(0) << "myvector contains:";
    530530//   for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ )
    531 //     COUT(0) << " " << (*itt).objID;
     531//     COUT(0) << ' ' << (*itt).objID;
    532532//   COUT(0) << endl;
    533533  for(it=dataVector_.begin(); it!=dataVector_.end();){
Note: See TracChangeset for help on using the changeset viewer.