Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (15 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/packet
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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.