Changeset 3301 for code/trunk/src/network/packet
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (15 years ago)
- Location:
- code/trunk/src/network/packet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/packet/Chat.cc
r3280 r3301 51 51 *(unsigned int *)(data_ + _PLAYERID ) = playerID; 52 52 *(unsigned int *)(data_ + _MESSAGELENGTH ) = messageLength_; 53 memcpy( data_+_MESSAGE, (void *)message.c_str(), messageLength_ );53 memcpy( data_+_MESSAGE, static_cast<void*>(const_cast<char*>(message.c_str())), messageLength_ ); 54 54 } 55 55 -
code/trunk/src/network/packet/Packet.cc
r3280 r3301 143 143 // Assures we don't create a packet and destroy it right after in another thread 144 144 // without having a reference in the packetMap_ 145 packetMap_[ (size_t)(void*)enetPacket_] = this;145 packetMap_[reinterpret_cast<size_t>(enetPacket_)] = this; 146 146 } 147 147 } … … 172 172 Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){ 173 173 uint8_t *data = packet->data; 174 assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2|| !Host::isServer());174 assert(ClientInformation::findClient(&peer->address)->getID() != static_cast<unsigned int>(-2) || !Host::isServer()); 175 175 unsigned int clientID = ClientInformation::findClient(&peer->address)->getID(); 176 176 Packet *p = 0; … … 230 230 void Packet::deletePacket(ENetPacket *enetPacket){ 231 231 // Get our Packet from a gloabal map with all Packets created in the send() method of Packet. 232 std::map<size_t, Packet*>::iterator it = packetMap_.find( (size_t)enetPacket);232 std::map<size_t, Packet*>::iterator it = packetMap_.find(reinterpret_cast<size_t>(enetPacket)); 233 233 assert(it != packetMap_.end()); 234 234 // Make sure we don't delete it again in the destructor
Note: See TracChangeset
for help on using the changeset viewer.