Changeset 3301 for code/trunk/src/util
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (16 years ago)
- Location:
- code/trunk/src/util
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/Clipboard.cc
r3214 r3301 66 66 EmptyClipboard(); 67 67 HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, text.size() + 1); 68 char* buffer = (char*)GlobalLock(clipbuffer);68 char* buffer = static_cast<char*>(GlobalLock(clipbuffer)); 69 69 strcpy(buffer, text.c_str()); 70 70 GlobalUnlock(clipbuffer); … … 94 94 { 95 95 HANDLE hData = GetClipboardData(CF_TEXT); 96 std::string output = (char*)GlobalLock(hData);96 std::string output = static_cast<char*>(GlobalLock(hData)); 97 97 GlobalUnlock(hData); 98 98 CloseClipboard(); -
code/trunk/src/util/MultiType.h
r3280 r3301 303 303 inline bool setValue(const char* value); 304 304 /** @brief Assigns a pointer. */ 305 template <typename V> inline bool setValue(V* value) { if (this->value_) { return this->value_->setValue( (void*)value); } else { return this->assignValue((void*)value); } }305 template <typename V> inline bool setValue(V* value) { if (this->value_) { return this->value_->setValue(static_cast<void*>(const_cast<typename TypeStripper<V>::RawType*>(value))); } else { return this->assignValue(static_cast<void*>(const_cast<typename TypeStripper<V>::RawType*>(value))); } } 306 306 /** @brief Assigns the value of the other MultiType and converts it to the current type. */ 307 307 bool setValue(const MultiType& other) { if (this->value_) { return this->value_->assimilate(other); } else { if (other.value_) { this->value_ = other.value_->clone(); } return true; } } … … 335 335 336 336 /** @brief Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT */ 337 inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); * (uint8_t*)(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }337 inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *static_cast<uint8_t*>(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); } 338 338 /** @brief Loads the value of the MT from a bytestream (pointed at by mem) and increases mem pointer by size of MT */ 339 inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(* (uint8_t*)mem)); mem+=sizeof(uint8_t); this->value_->importData(mem); }339 inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(*static_cast<uint8_t*>(mem))); mem+=sizeof(uint8_t); this->value_->importData(mem); } 340 340 /** @brief Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT */ 341 341 inline uint8_t*& operator << (uint8_t*& mem) { importData(mem); return mem; } … … 371 371 operator orxonox::Degree() const; 372 372 /** @brief Returns the current value, converted to a T* pointer. */ 373 template <class T> operator T*() const { return ( (T*)this->operator void*()); }373 template <class T> operator T*() const { return (static_cast<T*>(this->operator void*())); } 374 374 375 375 inline bool getValue(char* value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */ … … 420 420 inline orxonox::Radian getRadian() const { return this->operator orxonox::Radian(); } /** @brief Returns the current value, converted to the requested type. */ 421 421 inline orxonox::Degree getDegree() const { return this->operator orxonox::Degree(); } /** @brief Returns the current value, converted to the requested type. */ 422 template <typename T> inline T* getPointer() const { return ((T*)this->getVoid());} /** @brief Returns the current value, converted to a T* pointer. */422 template <typename T> inline T* getPointer() const { return static_cast<T*>(this->getVoid()); } /** @brief Returns the current value, converted to a T* pointer. */ 423 423 424 424 private: -
code/trunk/src/util/OutputHandler.cc
r2710 r3301 97 97 void OutputHandler::setSoftDebugLevel(OutputHandler::OutputDevice device, int level) 98 98 { 99 OutputHandler::getOutStream().softDebugLevel_[ (unsigned int)device] = level;99 OutputHandler::getOutStream().softDebugLevel_[static_cast<unsigned int>(device)] = level; 100 100 } 101 101 … … 107 107 int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device) 108 108 { 109 return OutputHandler::getOutStream().softDebugLevel_[ (unsigned int)device];109 return OutputHandler::getOutStream().softDebugLevel_[static_cast<unsigned int>(device)]; 110 110 } 111 111 -
code/trunk/src/util/SignalHandler.cc
r3198 r3301 203 203 dup2( gdbErr[1], STDERR_FILENO ); 204 204 205 execlp( "sh", "sh", "-c", "gdb", (void*)NULL);205 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(NULL)); 206 206 } 207 207 -
code/trunk/src/util/StringUtils.cc
r3300 r3301 125 125 126 126 size_t quotecount = 0; 127 size_t quote = (size_t)-1;127 size_t quote = static_cast<size_t>(-1); 128 128 while ((quote = getNextQuote(str, quote + 1)) < pos) 129 129 {
Note: See TracChangeset
for help on using the changeset viewer.