Changeset 3301 for code/trunk/src/network/synchronisable
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (16 years ago)
- Location:
- code/trunk/src/network/synchronisable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/synchronisable/Synchronisable.h
r3280 r3301 44 44 45 45 /*#define REGISTERDATA(varname, ...) \ 46 registerVariable( (void*)&varname, sizeof(varname), DATA, __VA_ARGS__)46 registerVariable(static_cast<void*>(&varname), sizeof(varname), DATA, __VA_ARGS__) 47 47 #define REGISTERSTRING(stringname, ...) \ 48 48 registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__)*/ -
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.