Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 21, 2016, 1:59:04 PM (8 years ago)
Author:
muemart
Message:

Fix some clang-tidy warnings.
Also, Serialise.h was doing some C-style casts that ended up being const casts. I moved those const casts as close to the source as possible and changed the loadAndIncrease functions to not do that.

Location:
code/trunk/src/libraries/network/packet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r11071 r11083  
    489489Gamestate* Gamestate::diffVariables(Gamestate *base)
    490490{
    491   assert(this && base); assert(data_ && base->data_);
     491  assert(base); assert(data_ && base->data_);
    492492  assert(!header_.isCompressed() && !base->header_.isCompressed());
    493493  assert(!header_.isDiffed());
  • code/trunk/src/libraries/network/packet/ServerInformation.cc

    r11071 r11083  
    5555      // Save ACK
    5656      uint8_t* temp = event->packet->data;
    57       char* ack = new char[strlen(LAN_DISCOVERY_ACK)+1];
     57      char* ack = nullptr;
    5858      loadAndIncrease((char*&)ack, temp);
    5959
     
    6464      // Save Server Name
    6565      loadAndIncrease(this->serverName_, temp);
     66      delete[] ack;
    6667    }
    6768
     
    7475    {
    7576      std::string payload = this->serverName_ + Ogre::StringConverter::toString(this->clientNumber_);
    76       uint32_t size = returnSize((char*&)LAN_DISCOVERY_ACK) + returnSize(payload);
     77      uint32_t size = returnSize(LAN_DISCOVERY_ACK) + returnSize(payload);
    7778      uint8_t* temp = new uint8_t[size];
    7879      uint8_t* temp2 = temp;
    79       saveAndIncrease((char*&)LAN_DISCOVERY_ACK, temp2);
     80      saveAndIncrease(LAN_DISCOVERY_ACK, temp2);
    8081      saveAndIncrease(payload, temp2);
    8182      ENetPacket* packet = enet_packet_create( temp, size, 0 );
Note: See TracChangeset for help on using the changeset viewer.