Index: code/branches/cpp11_v3/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/cpp11_v3/src/libraries/core/input/KeyBinder.cc	(revision 11053)
+++ code/branches/cpp11_v3/src/libraries/core/input/KeyBinder.cc	(revision 11054)
@@ -53,6 +53,6 @@
         : deriveTime_(0.0f)
         , filename_(filename)
-        , configFile_(NULL)
-        , fallbackConfigFile_(NULL)
+        , configFile_(nullptr)
+        , fallbackConfigFile_(nullptr)
     {
         mouseRelative_[0] = 0;
@@ -153,7 +153,7 @@
     void KeyBinder::buttonThresholdChanged()
     {
-        for (unsigned int i = 0; i < allHalfAxes_.size(); i++)
-            if (!allHalfAxes_[i]->bButtonThresholdUser_)
-                allHalfAxes_[i]->buttonThreshold_ = this->buttonThreshold_;
+        for (HalfAxis* halfAxis : allHalfAxes_)
+            if (!halfAxis->bButtonThresholdUser_)
+                halfAxis->buttonThreshold_ = this->buttonThreshold_;
     }
 
@@ -170,5 +170,5 @@
 
         // load the bindings if required
-        if (configFile_ != NULL)
+        if (configFile_ != nullptr)
         {
             for (unsigned int iDev = oldValue; iDev < joySticks_.size(); ++iDev)
@@ -188,7 +188,7 @@
     {
         while (joyStickAxes_.size() < joySticks_.size())
-            joyStickAxes_.push_back(shared_ptr<JoyStickAxisVector>(new JoyStickAxisVector()));
+            joyStickAxes_.push_back(std::make_shared<JoyStickAxisVector>());
         while (joyStickButtons_.size() < joySticks_.size())
-            joyStickButtons_.push_back(shared_ptr<JoyStickButtonVector>(new JoyStickButtonVector()));
+            joyStickButtons_.push_back(std::make_shared<JoyStickButtonVector>());
         // For the case the new size is smaller
         this->joyStickAxes_.resize(joySticks_.size());
@@ -274,8 +274,8 @@
 
         // Parse bindings and create the ConfigValueContainers if necessary
-        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
-        {
-            it->second->readBinding(this->configFile_, this->fallbackConfigFile_);
-            addButtonToCommand(it->second->bindingString_, it->second);
+        for (const auto& mapEntry : allButtons_)
+        {
+            mapEntry.second->readBinding(this->configFile_, this->fallbackConfigFile_);
+            addButtonToCommand(mapEntry.second->bindingString_, mapEntry.second);
         }
 
@@ -420,9 +420,9 @@
     void KeyBinder::clearBindings()
     {
-        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
-            it->second->clear();
-
-        for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
-            delete paramCommandBuffer_[i];
+        for (const auto& mapEntry : allButtons_)
+            mapEntry.second->clear();
+
+        for (BufferedParamCommand* command : paramCommandBuffer_)
+            delete command;
         paramCommandBuffer_.clear();
     }
@@ -434,7 +434,7 @@
     {
         // iterate over all buttons
-        for (std::map<std::string, Button*>::iterator it = this->allButtons_.begin(); it != this->allButtons_.end(); ++it)
-        {
-            Button* button = it->second;
+        for (const auto& mapEntry : this->allButtons_)
+        {
+            Button* button = mapEntry.second;
 
             // iterate over all modes
@@ -479,5 +479,5 @@
                         {
                             delete[] button->commands_[mode_index];
-                            button->commands_[mode_index] = 0;
+                            button->commands_[mode_index] = nullptr;
                         }
 
@@ -505,6 +505,6 @@
         this->mousePosition_[1] = 0.0f;
 
-        for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
-            mouseAxes_[i].reset();
+        for (HalfAxis& axis : mouseAxes_)
+            axis.reset();
     }
 
@@ -545,5 +545,5 @@
         }
 
-        for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
+        for (HalfAxis& axis : mouseAxes_)
         {
             // Why dividing relative value by dt? The reason lies in the simple fact, that when you
@@ -555,8 +555,8 @@
             {
                 // just ignore if dt == 0.0 because we have multiplied by 0.0 anyway..
-                mouseAxes_[i].relVal_ /= dt;
-            }
-
-            tickHalfAxis(mouseAxes_[i]);
+                axis.relVal_ /= dt;
+            }
+
+            tickHalfAxis(axis);
         }
     }
