Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/libraries/core/input
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc

    r10624 r10765  
    210210        catch (const std::exception& ex)
    211211        {
    212             oisInputManager_ = NULL;
     212            oisInputManager_ = nullptr;
    213213            internalState_ |= Bad;
    214214            ThrowException(InitialisationFailed, "Could not initialise the input system: " << ex.what());
     
    312312        BOOST_FOREACH(InputDevice*& device, devices_)
    313313        {
    314             if (device == NULL)
     314            if (device == nullptr)
    315315                continue;
    316316            const std::string& className = device->getClassName();
     
    321321        devices_.resize(InputDeviceEnumerator::FirstJoyStick);
    322322
    323         assert(oisInputManager_ != NULL);
     323        assert(oisInputManager_ != nullptr);
    324324        try
    325325        {
     
    331331                                                   << "Potential resource leak!" << endl;
    332332        }
    333         oisInputManager_ = NULL;
     333        oisInputManager_ = nullptr;
    334334
    335335        internalState_ |= Bad;
     
    388388        // No event gets triggered here yet!
    389389        BOOST_FOREACH(InputDevice* device, devices_)
    390             if (device != NULL)
     390            if (device != nullptr)
    391391                device->update(time);
    392392
     
    419419        for (unsigned int i = 0; i < devices_.size(); ++i)
    420420        {
    421             if (devices_[i] == NULL)
     421            if (devices_[i] == nullptr)
    422422                continue;
    423423            std::vector<InputState*>& states = devices_[i]->getStateListRef();
     
    439439        std::set<InputState*> tempSet;
    440440        for (unsigned int i = 0; i < devices_.size(); ++i)
    441             if (devices_[i] != NULL)
     441            if (devices_[i] != nullptr)
    442442                for (unsigned int iState = 0; iState < devices_[i]->getStateListRef().size(); ++iState)
    443443                    tempSet.insert(devices_[i]->getStateListRef()[iState]);
     
    467467    {
    468468        BOOST_FOREACH(InputDevice* device, devices_)
    469             if (device != NULL)
     469            if (device != nullptr)
    470470                device->clearBuffers();
    471471    }
     
    477477
    478478        BOOST_FOREACH(InputDevice* device, devices_)
    479             if (device != NULL)
     479            if (device != nullptr)
    480480                device->startCalibration();
    481481
     
    488488    {
    489489        BOOST_FOREACH(InputDevice* device, devices_)
    490             if (device != NULL)
     490            if (device != nullptr)
    491491                device->stopCalibration();
    492492
     
    509509    {
    510510        Mouse* mouse = static_cast<Mouse*>(devices_[InputDeviceEnumerator::Mouse]);
    511         if (mouse != NULL)
     511        if (mouse != nullptr)
    512512        {
    513513            const OIS::MouseState state = mouse->getOISDevice()->getMouseState();
  • code/branches/cpp11_v2/src/libraries/core/input/InputManager.h

    r8729 r10765  
    134134            Returns a pointer to a InputState referenced by name.
    135135        @return
    136             Returns NULL if state was not found.
     136            Returns nullptr if state was not found.
    137137        */
    138138        InputState* getState(const std::string& name);
  • code/branches/cpp11_v2/src/libraries/core/input/InputState.cc

    r8729 r10765  
    4949            priority_ = 0;
    5050
    51         handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), NULL);
     51        handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), nullptr);
    5252    }
    5353
     
    5555    {
    5656        if (device < handlers_.size())
    57             return handlers_[device] != NULL;
     57            return handlers_[device] != nullptr;
    5858        else
    5959            return false;
     
    6464    {
    6565        unsigned int oldSize = handlers_.size();
    66         handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), NULL);
     66        handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), nullptr);
    6767
    6868        for (unsigned int i = oldSize; i < handlers_.size(); ++i)
  • code/branches/cpp11_v2/src/libraries/core/input/InputState.h

    r8729 r10765  
    179179    {
    180180        for (unsigned int i = 0; i < handlers_.size(); ++i)
    181             if (handlers_[i] != NULL)
     181            if (handlers_[i] != nullptr)
    182182                INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt);
    183183    }
     
    188188        {
    189189        case InputDeviceEnumerator::Keyboard:
    190             if (handlers_[keyboardIndex_s] != NULL)
     190            if (handlers_[keyboardIndex_s] != nullptr)
    191191                INPUT_STATE_PUSH_CALL(keyboardIndex_s, keyboardUpdated, dt);
    192192            break;
    193193
    194194        case InputDeviceEnumerator::Mouse:
    195             if (handlers_[mouseIndex_s] != NULL)
     195            if (handlers_[mouseIndex_s] != nullptr)
    196196                INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseUpdated, dt);
    197197            break;
    198198
    199199        default: // joy sticks
    200             if (handlers_[device] != NULL)
     200            if (handlers_[device] != nullptr)
    201201                INPUT_STATE_PUSH_CALL(device, joyStickUpdated, device - firstJoyStickIndex_s, dt);
    202202            break;
     
    208208    {
    209209        assert(device < handlers_.size());
    210         if (handlers_[device] != NULL)
     210        if (handlers_[device] != nullptr)
    211211        {
    212212            // We have to store the function pointer to tell the compiler about its actual type because of overloading
     
    218218    ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    219219    {
    220         if (handlers_[mouseIndex_s] != NULL)
     220        if (handlers_[mouseIndex_s] != nullptr)
    221221            INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize);
    222222    }
     
    224224    ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
    225225    {
    226         if (handlers_[mouseIndex_s] != NULL)
     226        if (handlers_[mouseIndex_s] != nullptr)
    227227            INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel);
    228228    }
     
    231231    {
    232232        assert(device < handlers_.size());
    233         if (handlers_[device] != NULL)
     233        if (handlers_[device] != nullptr)
    234234            INPUT_STATE_PUSH_CALL(device, axisMoved, device - firstJoyStickIndex_s, axis, value);
    235235    }
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc

    r10624 r10765  
    5353        : deriveTime_(0.0f)
    5454        , filename_(filename)
    55         , configFile_(NULL)
    56         , fallbackConfigFile_(NULL)
     55        , configFile_(nullptr)
     56        , fallbackConfigFile_(nullptr)
    5757    {
    5858        mouseRelative_[0] = 0;
     
    170170
    171171        // load the bindings if required
    172         if (configFile_ != NULL)
     172        if (configFile_ != nullptr)
    173173        {
    174174            for (unsigned int iDev = oldValue; iDev < joySticks_.size(); ++iDev)
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h

    r9978 r10765  
    159159        //! Name of the file used in this KeyBinder (constant!)
    160160        const std::string filename_;
    161         //! Config file used. NULL in case of KeyDetector. Also indicates whether we've already loaded.
     161        //! Config file used. nullptr in case of KeyDetector. Also indicates whether we've already loaded.
    162162        ConfigFile* configFile_;
    163163        //! Config file from the data directory that only serves as fallback
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc

    r10624 r10765  
    5656
    5757    KeyBinderManager::KeyBinderManager()
    58         : currentBinder_(NULL)
     58        : currentBinder_(nullptr)
    5959        , bDefaultFileLoaded_(true)
    6060        , bBinding_(false)
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.h

    r9667 r10765  
    107107
    108108        // KeyBinder management
    109         KeyBinder* currentBinder_;                   //! Currently selected KeyBinder (never NULL!)
     109        KeyBinder* currentBinder_;                   //! Currently selected KeyBinder (never nullptr!)
    110110        std::map<std::string, KeyBinder*> binders_;  //! All loaded KeyBinders
    111111        bool bDefaultFileLoaded_;                    //! Tells whether the default one is loaded
  • code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc

    r10624 r10765  
    6262    KeyDetector::~KeyDetector()
    6363    {
    64         inputState_->setHandler(NULL);
     64        inputState_->setHandler(nullptr);
    6565        InputManager::getInstance().destroyState("detector");
    6666        ModifyConsoleCommand(__CC_KeyDetector_callback_name).resetFunction();
Note: See TracChangeset for help on using the changeset viewer.