Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6960


Ignore:
Timestamp:
May 21, 2010, 6:49:29 PM (14 years ago)
Author:
scheusso
Message:

can't imagine how this worked so long

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/libraries/network/packet/ClassID.cc

    r6417 r6960  
    6565    tempQueue.push( std::pair<unsigned int, std::string>(network_id, classname) );
    6666    ++nrOfClasses;
    67     packetSize += (classname.size()+1)+sizeof(uint32_t)+sizeof(uint32_t);
     67    packetSize += (classname.size()+1)+sizeof(network_id)+sizeof(uint32_t);
    6868  }
    6969
     
    8080  // now save all classids and classnames
    8181  std::pair<uint32_t, std::string> tempPair;
     82  uint32_t tempsize = 2*sizeof(uint32_t); // packetid and nrOfClasses
    8283  while( !tempQueue.empty() ){
    8384    tempPair = tempQueue.front();
     
    8788    memcpy(temp+2*sizeof(uint32_t), tempPair.second.c_str(), tempPair.second.size()+1);
    8889    temp+=2*sizeof(uint32_t)+tempPair.second.size()+1;
     90    tempsize+=2*sizeof(uint32_t)+tempPair.second.size()+1;
    8991  }
     92  assert(tempsize=packetSize);
    9093
    9194  COUT(5) << "classid packetSize is " << packetSize << endl;
     
    111114  for(unsigned int i=0; i<nrOfClasses; i++){
    112115    totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t));
     116    temp += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t));
    113117  }
    114118  return totalsize;
Note: See TracChangeset for help on using the changeset viewer.