Changeset 3301 for code/trunk/src/core
- Timestamp:
- Jul 18, 2009, 4:03:59 PM (15 years ago)
- Location:
- code/trunk/src/core
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/ConfigFileManager.cc
r3280 r3301 572 572 else 573 573 { 574 COUT(1) << "ConfigFileManager: Can't find a config file for type with ID " << (int)type<< std::endl;574 COUT(1) << "ConfigFileManager: Can't find a config file for type with ID " << static_cast<int>(type) << std::endl; 575 575 COUT(1) << "Using " << DEFAULT_CONFIG_FILE << " file." << std::endl; 576 576 this->setFilename(type, DEFAULT_CONFIG_FILE); -
code/trunk/src/core/ConfigValueContainer.h
r3196 r3301 69 69 inline virtual ~ConfigValueCallback() {} 70 70 inline virtual void call(void* object) 71 { if (!Identifier::isCreatingHierarchy()) { (((T*)object)->*this->function_)(); } } 71 { 72 if (!Identifier::isCreatingHierarchy()) 73 (static_cast<T*>(object)->*this->function_)(); 74 } 72 75 73 76 private: -
code/trunk/src/core/Executor.cc
r3280 r3301 99 99 100 100 // assign all given arguments to the multitypes 101 for (unsigned int i = 0; i < std::min(tokens.size(), (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)101 for (unsigned int i = 0; i < std::min(tokens.size(), MAX_FUNCTOR_ARGUMENTS); i++) 102 102 param[i] = tokens[i]; 103 103 104 104 // fill the remaining multitypes with default values 105 for (unsigned int i = tokens.size(); i < std::min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)105 for (unsigned int i = tokens.size(); i < std::min(paramCount, MAX_FUNCTOR_ARGUMENTS); i++) 106 106 param[i] = this->defaultValue_[i]; 107 107 108 108 // evaluate the param types through the functor 109 for (unsigned int i = 0; i < std::min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)109 for (unsigned int i = 0; i < std::min(paramCount, MAX_FUNCTOR_ARGUMENTS); i++) 110 110 this->functor_->evaluateParam(i, param[i]); 111 111 -
code/trunk/src/core/Executor.h
r3280 r3301 104 104 COUT(5) << tokens[i]; \ 105 105 } \ 106 COUT(5) << ") and " << std::max( (int)paramCount - (int)tokens.size(), 0) << " default values ("; \106 COUT(5) << ") and " << std::max(static_cast<int>(paramCount) - static_cast<int>(tokens.size()), 0) << " default values ("; \ 107 107 for (unsigned int i = tokens.size(); i < paramCount; i++) \ 108 108 { \ -
code/trunk/src/core/IRC.cc
r3280 r3301 52 52 void IRC::initialize() 53 53 { 54 unsigned int threadID = (unsigned int)IRC_TCL_THREADID;54 unsigned int threadID = IRC_TCL_THREADID; 55 55 TclThreadManager::createID(threadID); 56 56 this->bundle_ = TclThreadManager::getInstance().getInterpreterBundle(threadID); -
code/trunk/src/core/LuaBind.cc
r3280 r3301 124 124 const char * LuaBind::lua_Chunkreader(lua_State *L, void *data, size_t *size) 125 125 { 126 LoadS* ls = ((LoadS*)data);126 LoadS* ls = static_cast<LoadS*>(data); 127 127 if (ls->size == 0) return NULL; 128 128 *size = ls->size; -
code/trunk/src/core/Shell.cc
r3300 r3301 228 228 std::string Shell::getFromHistory() const 229 229 { 230 unsigned int index = mod( ((int)this->historyOffset_) - ((int)this->historyPosition_), this->maxHistoryLength_);230 unsigned int index = mod(static_cast<int>(this->historyOffset_) - static_cast<int>(this->historyPosition_), this->maxHistoryLength_); 231 231 if (index < this->commandHistory_.size() && this->historyPosition_ != 0) 232 232 return this->commandHistory_[index]; … … 249 249 { 250 250 if (this->bAddOutputLevel_) 251 output.insert(0, 1, (char)OutputHandler::getOutStream().getOutputLevel());251 output.insert(0, 1, static_cast<char>(OutputHandler::getOutStream().getOutputLevel())); 252 252 253 253 this->lines_.insert(this->lines_.begin(), output); -
code/trunk/src/core/Super.h
r3196 r3301 91 91 static void check() \ 92 92 { \ 93 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply( (T*)0); \93 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \ 94 94 SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::check(); \ 95 95 } \ … … 149 149 // This call to the apply-function is the whole check. By calling the function with 150 150 // a T* pointer, the right function get's called. 151 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply( (T*)0);151 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); 152 152 153 153 // Go go the check for of next super-function (functionnumber + 1) -
code/trunk/src/core/TclThreadManager.cc
r3300 r3301 278 278 std::string TclThreadManager::tcl_query(int querierID, Tcl::object const &args) 279 279 { 280 return TclThreadManager::getInstance().evalQuery( (unsigned int)querierID, stripEnclosingBraces(args.get()));280 return TclThreadManager::getInstance().evalQuery(static_cast<unsigned int>(querierID), stripEnclosingBraces(args.get())); 281 281 } 282 282 283 283 std::string TclThreadManager::tcl_crossquery(int querierID, int threadID, Tcl::object const &args) 284 284 { 285 return TclThreadManager::getInstance().evalQuery( (unsigned int)querierID, (unsigned int)threadID, stripEnclosingBraces(args.get()));285 return TclThreadManager::getInstance().evalQuery(static_cast<unsigned int>(querierID), static_cast<unsigned int>(threadID), stripEnclosingBraces(args.get())); 286 286 } 287 287 288 288 bool TclThreadManager::tcl_running(int threadID) 289 289 { 290 TclInterpreterBundle* bundle = TclThreadManager::getInstance().getInterpreterBundle( (unsigned int)threadID);290 TclInterpreterBundle* bundle = TclThreadManager::getInstance().getInterpreterBundle(static_cast<unsigned int>(threadID)); 291 291 if (bundle) 292 292 { … … 556 556 try 557 557 { 558 if (querierID == 0 || std::find(querier->queriers_.begin(), querier->queriers_.end(), (unsigned int)0) != querier->queriers_.end())558 if (querierID == 0 || std::find(querier->queriers_.begin(), querier->queriers_.end(), 0U) != querier->queriers_.end()) 559 559 successfullyLocked = interpreter_lock.try_lock(); 560 560 else … … 631 631 boost::try_mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_); 632 632 #endif 633 unsigned long maxtime = (unsigned long)(time.getDeltaTime() * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);633 unsigned long maxtime = static_cast<unsigned long>(time.getDeltaTime() * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE); 634 634 Ogre::Timer timer; 635 635 while (!this->queueIsEmpty()) -
code/trunk/src/core/XMLPort.h
r3196 r3301 93 93 */ 94 94 #define XMLPortParamVariable(classname, paramname, variable, xmlelement, mode) \ 95 XMLPortVariableHelperClass xmlcontainer##variable##dummy( (void*)&variable); \95 XMLPortVariableHelperClass xmlcontainer##variable##dummy(static_cast<void*>(&variable)); \ 96 96 static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##loadexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader")); \ 97 97 static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##saveexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" )); \ … … 561 561 COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 562 562 563 BaseObject* newObject = identifier->fabricate( (BaseObject*)object);563 BaseObject* newObject = identifier->fabricate(static_cast<BaseObject*>(object)); 564 564 assert(newObject); 565 565 newObject->setLoaderIndentation(object->getLoaderIndentation() + " "); … … 571 571 { 572 572 newObject->XMLPort(*child, XMLPort::LoadObject); 573 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;573 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ")" << std::endl; 574 574 } 575 575 else 576 576 { 577 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;577 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << static_cast<BaseObject*>(object)->getName() << ")" << std::endl; 578 578 } 579 579 … … 671 671 template <class T> 672 672 void load(const T& value) 673 { * ((T*)this->variable_) = value; }673 { *static_cast<T*>(this->variable_) = value; } 674 674 675 675 template <class T> 676 676 const T& save() 677 { return * ((T*)this->variable_); }677 { return *static_cast<T*>(this->variable_); } 678 678 679 679 template <class T> -
code/trunk/src/core/input/InputBuffer.cc
r3196 r3301 218 218 } 219 219 220 this->insert( (char)evt.text);220 this->insert(static_cast<char>(evt.text)); 221 221 } 222 222 -
code/trunk/src/core/input/InputManager.cc
r3280 r3301 175 175 176 176 // Fill parameter list 177 windowHndStr << (unsigned int)windowHnd_;177 windowHndStr << static_cast<unsigned int>(windowHnd); 178 178 paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); 179 179 #if defined(ORXONOX_PLATFORM_WINDOWS) -
code/trunk/src/core/input/KeyBinder.cc
r3280 r3301 444 444 if (mousePosition_[i] < 0) 445 445 { 446 mouseAxes_[2*i + 0].absVal_ = -mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;447 mouseAxes_[2*i + 1].absVal_ = 446 mouseAxes_[2*i + 0].absVal_ = -mouseSensitivity_ * mousePosition_[i] / mouseClippingSize_; 447 mouseAxes_[2*i + 1].absVal_ = 0.0f; 448 448 } 449 449 else 450 450 { 451 mouseAxes_[2*i + 0].absVal_ = 452 mouseAxes_[2*i + 1].absVal_ = mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;451 mouseAxes_[2*i + 0].absVal_ = 0.0f; 452 mouseAxes_[2*i + 1].absVal_ = mouseSensitivity_ * mousePosition_[i] / mouseClippingSize_; 453 453 } 454 454 } … … 460 460 { 461 461 if (rel[i] < 0) 462 mouseAxes_[0 + 2*i].relVal_ = - ((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;462 mouseAxes_[0 + 2*i].relVal_ = -mouseSensitivity_ * rel[i] / mouseClippingSize_; 463 463 else 464 mouseAxes_[1 + 2*i].relVal_ = ((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;464 mouseAxes_[1 + 2*i].relVal_ = mouseSensitivity_ * rel[i] / mouseClippingSize_; 465 465 } 466 466 } … … 474 474 if (rel < 0) 475 475 for (int i = 0; i < -rel/mouseWheelStepSize_; i++) 476 mouseButtons_[8].execute(KeybindMode::OnPress, ((float)abs)/mouseWheelStepSize_);476 mouseButtons_[8].execute(KeybindMode::OnPress, static_cast<float>(abs)/mouseWheelStepSize_); 477 477 else 478 478 for (int i = 0; i < rel/mouseWheelStepSize_; i++) 479 mouseButtons_[9].execute(KeybindMode::OnPress, ((float)abs)/mouseWheelStepSize_);479 mouseButtons_[9].execute(KeybindMode::OnPress, static_cast<float>(abs)/mouseWheelStepSize_); 480 480 } 481 481
Note: See TracChangeset
for help on using the changeset viewer.