Changeset 7011
- Timestamp:
- May 30, 2010, 12:26:27 PM (14 years ago)
- Location:
- code/branches/rocket2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket2
- Property svn:mergeinfo changed
/code/branches/presentation3 (added) merged: 6960
- Property svn:mergeinfo changed
-
code/branches/rocket2/src/libraries/network/packet/ClassID.cc
r6417 r7011 65 65 tempQueue.push( std::pair<unsigned int, std::string>(network_id, classname) ); 66 66 ++nrOfClasses; 67 packetSize += (classname.size()+1)+sizeof( uint32_t)+sizeof(uint32_t);67 packetSize += (classname.size()+1)+sizeof(network_id)+sizeof(uint32_t); 68 68 } 69 69 … … 80 80 // now save all classids and classnames 81 81 std::pair<uint32_t, std::string> tempPair; 82 uint32_t tempsize = 2*sizeof(uint32_t); // packetid and nrOfClasses 82 83 while( !tempQueue.empty() ){ 83 84 tempPair = tempQueue.front(); … … 87 88 memcpy(temp+2*sizeof(uint32_t), tempPair.second.c_str(), tempPair.second.size()+1); 88 89 temp+=2*sizeof(uint32_t)+tempPair.second.size()+1; 90 tempsize+=2*sizeof(uint32_t)+tempPair.second.size()+1; 89 91 } 92 assert(tempsize=packetSize); 90 93 91 94 COUT(5) << "classid packetSize is " << packetSize << endl; … … 111 114 for(unsigned int i=0; i<nrOfClasses; i++){ 112 115 totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t)); 116 temp += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t)); 113 117 } 114 118 return totalsize;
Note: See TracChangeset
for help on using the changeset viewer.