Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2009, 4:03:59 PM (15 years ago)
Author:
rgrieder
Message:

Found even more casts. They sure aren't all of them, but I hope to have caught every pointer C-style cast because they can be very dangerous.
Note: I didn't do the pointer casts in the network library because that would have taken way too long.

Location:
code/trunk/src/core/input
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/input/InputBuffer.cc

    r3196 r3301  
    218218        }
    219219
    220         this->insert((char)evt.text);
     220        this->insert(static_cast<char>(evt.text));
    221221    }
    222222
  • code/trunk/src/core/input/InputManager.cc

    r3280 r3301  
    175175
    176176            // Fill parameter list
    177             windowHndStr << (unsigned int)windowHnd_;
     177            windowHndStr << static_cast<unsigned int>(windowHnd);
    178178            paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
    179179#if defined(ORXONOX_PLATFORM_WINDOWS)
  • code/trunk/src/core/input/KeyBinder.cc

    r3280 r3301  
    444444                    if (mousePosition_[i] < 0)
    445445                    {
    446                         mouseAxes_[2*i + 0].absVal_ =  -mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;
    447                         mouseAxes_[2*i + 1].absVal_ =  0.0f;
     446                        mouseAxes_[2*i + 0].absVal_ = -mouseSensitivity_ * mousePosition_[i] / mouseClippingSize_;
     447                        mouseAxes_[2*i + 1].absVal_ = 0.0f;
    448448                    }
    449449                    else
    450450                    {
    451                         mouseAxes_[2*i + 0].absVal_ =  0.0f;
    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_;
    453453                    }
    454454                }
     
    460460        {
    461461            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_;
    463463            else
    464                 mouseAxes_[1 + 2*i].relVal_ =  ((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;
     464                mouseAxes_[1 + 2*i].relVal_ =  mouseSensitivity_ * rel[i] / mouseClippingSize_;
    465465        }
    466466    }
     
    474474        if (rel < 0)
    475475            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_);
    477477        else
    478478            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_);
    480480    }
    481481
Note: See TracChangeset for help on using the changeset viewer.