Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 28, 2009, 12:35:04 PM (16 years ago)
Author:
scheusso
Message:

fixed a bug when building in release mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/src/network/synchronisable/SynchronisableVariable.cc

    r2662 r2706  
    362362{
    363363  double temp;
    364   *(uint64_t*)(&temp) = *(uint64_t*)(mem);
     364  memcpy(&temp, mem, sizeof(uint64_t));
     365  //*(uint64_t*)(&temp) = *(uint64_t*)(mem);
    365366  *(long double*)(&this->variable_) = static_cast<const long double>(temp);
    366367  mem += SynchronisableVariable<const long double>::returnSize();
     
    370371{
    371372  double temp = static_cast<double>(this->variable_);
    372   *(uint64_t*)(mem) = *(uint64_t*)(&temp);
     373  memcpy(mem, &temp, sizeof(uint64_t));
    373374  mem += SynchronisableVariable<const long double>::returnSize();
    374375}
     
    377378{
    378379  double temp = static_cast<double>(this->variable_);
    379   return *(uint64_t*)(mem) == *(uint64_t*)(&temp);
     380  return memcmp(&temp, mem, sizeof(uint64_t))==0;
     381  //return *(uint64_t*)(mem) == *(uint64_t*)(&temp);
    380382}
    381383
Note: See TracChangeset for help on using the changeset viewer.