Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2015, 10:54:34 PM (8 years ago)
Author:
landauf
Message:

replace '0' by 'nullptr'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc

    r10765 r10768  
    6969  packetDirection_ = Direction::Outgoing;
    7070  peerID_=0;
    71   data_=0;
    72   enetPacket_=0;
     71  data_=nullptr;
     72  enetPacket_=nullptr;
    7373  bDataENetAllocated_ = false;
    7474}
     
    8080  peerID_=peerID;
    8181  data_=data;
    82   enetPacket_=0;
     82  enetPacket_=nullptr;
    8383  bDataENetAllocated_ = false;
    8484}
     
    9595    memcpy(data_, p.data_, p.getSize());
    9696  }else
    97     data_=0;
     97    data_=nullptr;
    9898  bDataENetAllocated_ = p.bDataENetAllocated_;
    9999}
     
    175175#endif
    176176//  ENetPacket *temp = enetPacket_;
    177 //  enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet
     177//  enetPacket_ = nullptr; // otherwise we have a double free because enet already handles the deallocation of the packet
    178178  if( this->flags_ & PacketFlag::Reliable )
    179179    host->addPacket( enetPacket_, peerID_, NETWORK_CHANNEL_DEFAULT);
     
    191191//   if( peerID==static_cast<unsigned int>(-2))
    192192//     peerID = NETWORK_PEER_ID_SERVER;
    193   Packet *p = 0;
     193  Packet *p = nullptr;
    194194//   orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl;
    195195  switch( *(Type::Value *)(data + _PACKETID) )
     
    251251  assert(it != packetMap_.end());
    252252  // Make sure we don't delete it again in the destructor
    253   it->second->enetPacket_ = 0;
     253  it->second->enetPacket_ = nullptr;
    254254  delete it->second;
    255255  packetMap_.erase(it);
Note: See TracChangeset for help on using the changeset viewer.