diff --git a/src/SFML/Audio/SoundFileWriterFlac.cpp b/src/SFML/Audio/SoundFileWriterFlac.cpp index ddd3c20a0..798116553 100644 --- a/src/SFML/Audio/SoundFileWriterFlac.cpp +++ b/src/SFML/Audio/SoundFileWriterFlac.cpp @@ -39,7 +39,7 @@ namespace priv //////////////////////////////////////////////////////////// bool SoundFileWriterFlac::check(const std::string& filename) { - std::string extension = filename.substr(filename.find_last_of(".") + 1); + std::string extension = filename.substr(filename.find_last_of('.') + 1); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); return extension == "flac"; diff --git a/src/SFML/Audio/SoundFileWriterOgg.cpp b/src/SFML/Audio/SoundFileWriterOgg.cpp index c56847e5a..a1f2240b8 100644 --- a/src/SFML/Audio/SoundFileWriterOgg.cpp +++ b/src/SFML/Audio/SoundFileWriterOgg.cpp @@ -40,7 +40,7 @@ namespace priv //////////////////////////////////////////////////////////// bool SoundFileWriterOgg::check(const std::string& filename) { - std::string extension = filename.substr(filename.find_last_of(".") + 1); + std::string extension = filename.substr(filename.find_last_of('.') + 1); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); return extension == "ogg"; diff --git a/src/SFML/Audio/SoundFileWriterWav.cpp b/src/SFML/Audio/SoundFileWriterWav.cpp index 4f82d5ef2..695f83777 100644 --- a/src/SFML/Audio/SoundFileWriterWav.cpp +++ b/src/SFML/Audio/SoundFileWriterWav.cpp @@ -77,7 +77,7 @@ namespace priv //////////////////////////////////////////////////////////// bool SoundFileWriterWav::check(const std::string& filename) { - std::string extension = filename.substr(filename.find_last_of(".") + 1); + std::string extension = filename.substr(filename.find_last_of('.') + 1); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); return extension == "wav"; diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp index 6b5ebce81..54cc34fde 100644 --- a/src/SFML/Network/Ftp.cpp +++ b/src/SFML/Network/Ftp.cpp @@ -366,7 +366,7 @@ Ftp::Response Ftp::sendCommand(const std::string& command, const std::string& pa { // Build the command string std::string commandStr; - if (parameter != "") + if (!parameter.empty()) commandStr = command + " " + parameter + "\r\n"; else commandStr = command + "\r\n"; diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index 40a5167f1..f9b847ec3 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -327,7 +327,7 @@ void Http::setHost(const std::string& host, unsigned short port) { // HTTPS protocol -- unsupported (requires encryption and certificates and stuff...) err() << "HTTPS protocol is not supported by sf::Http" << std::endl; - m_hostName = ""; + m_hostName.clear(); m_port = 0; } else diff --git a/src/SFML/Window/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp index d251f4ebf..157d7829e 100644 --- a/src/SFML/Window/WindowImpl.cpp +++ b/src/SFML/Window/WindowImpl.cpp @@ -181,7 +181,6 @@ void WindowImpl::processJoystickEvents() // Copy the previous state of the joystick and get the new one JoystickState previousState = m_joystickStates[i]; m_joystickStates[i] = JoystickManager::getInstance().getState(i); - JoystickCaps caps = JoystickManager::getInstance().getCapabilities(i); // Connection state bool connected = m_joystickStates[i].connected; @@ -199,6 +198,8 @@ void WindowImpl::processJoystickEvents() if (connected) { + JoystickCaps caps = JoystickManager::getInstance().getCapabilities(i); + // Axes for (unsigned int j = 0; j < Joystick::AxisCount; ++j) {