- Timestamp:
- Jul 18, 2009, 4:03:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/synchronisable/SynchronisableVariable.h
r3280 r3301 36 36 #include <cstring> 37 37 #include "util/Serialise.h" 38 #include "util/TemplateUtils.h" 38 39 #include "core/GameMode.h" 39 40 #include "network/synchronisable/NetworkCallbackManager.h" … … 78 79 virtual inline void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false); 79 80 virtual inline uint32_t getSize(uint8_t mode); 80 virtual inline void* getReference(){ return (void *)&this->variable_; }81 virtual inline void* getReference(){ return static_cast<void*>(const_cast<typename TypeStripper<T>::RawType*>(&this->variable_)); } 81 82 protected: 82 83 … … 178 179 { 179 180 this->varReference_++; 180 memcpy( (void*)&this->varBuffer_, &this->variable_, sizeof(this->variable_));181 memcpy(static_cast<void*>(const_cast<typename TypeStripper<T>::RawType*>(&this->varBuffer_)), &this->variable_, sizeof(this->variable_)); 181 182 } 182 183 } … … 211 212 { 212 213 mem += sizeof(varReference_); 213 memcpy( (void*)&this->varBuffer_, &this->variable_, sizeof(T));214 memcpy(static_cast<void*>(const_cast<typename TypeStripper<T>::RawType*>(&this->varBuffer_)), &this->variable_, sizeof(T)); 214 215 if ( this->callback_ != 0 ) 215 216 callback = true;
Note: See TracChangeset
for help on using the changeset viewer.