Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2008, 2:07:32 PM (16 years ago)
Author:
scheusso
Message:

endianness test

Location:
code/branches/network64/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network64/src/network/packet/Welcome.cc

    r2211 r2316  
    4343#define _CLIENTID             _PACKETID + sizeof(ENUM::Type)
    4444#define _SHIPID               _CLIENTID + sizeof(uint32_t)
     45#define _ENDIANTEST           _SHIPID + sizeof(uint32_t)
    4546 
    4647  Welcome::Welcome( unsigned int clientID, unsigned int shipID )
     
    5253  assert(data_);
    5354  *(packet::ENUM::Type *)(data_ + _PACKETID ) = packet::ENUM::Welcome;
    54   *(uint32_t *)&data_[ _CLIENTID ] = clientID;
    55   *(uint32_t *)&data_[ _SHIPID ] = shipID;
     55  *(uint32_t *)(data_ + _CLIENTID ) = clientID;
     56  *(uint32_t *)(data_ + _SHIPID ) = shipID;
     57  *(uint32_t *)(data_ + _ENDIANTEST ) = 0xFEDC4321;
    5658}
    5759
     
    7072
    7173unsigned int Welcome::getSize() const{
    72   return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t);
     74  return sizeof(packet::ENUM::Type) + 3*sizeof(uint32_t);
    7375}
    7476
     
    7779  clientID = *(uint32_t *)&data_[ _CLIENTID ];
    7880  shipID = *(uint32_t *)&data_[ _SHIPID ];
     81  assert(*(uint32_t *)(data_ + _ENDIANTEST ) == 0xFEDC4321);
    7982  Host::setClientID(clientID);
    8083  Host::setShipID(shipID);
  • code/branches/network64/src/network/synchronisable/Synchronisable.cc

    r2309 r2316  
    303303    //std::cout << "inside getData" << std::endl;
    304304    uint32_t tempsize = 0;
    305     if(classID==0)
     305    if (this->classID==0)
    306306      COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
    307307
Note: See TracChangeset for help on using the changeset viewer.