Merge pull request #3004 from ngosang/cppcheck_fixes

Cppcheck: scope reduction & unused variables
This commit is contained in:
sledgehammer999
2015-06-13 20:16:53 +03:00
3 changed files with 3 additions and 7 deletions

View File

@@ -79,9 +79,8 @@ RequestParser::ErrorCode RequestParser::parseHttpRequest(const QByteArray& data,
}
// Parse HTTP request message
int content_length = 0;
if (m_request.headers.contains("content-length")) {
content_length = m_request.headers["content-length"].toInt();
int content_length = m_request.headers["content-length"].toInt();
if (content_length > static_cast<int>(m_maxContentLength)) {
qWarning() << Q_FUNC_INFO << "bad request: message too long";
return BadRequest;

View File

@@ -145,9 +145,7 @@ void Utils::Misc::shutdownComputer(ShutdownAction action)
AppleEvent eventReply = {typeNull, NULL};
AppleEvent appleEventToSend = {typeNull, NULL};
OSStatus error = noErr;
error = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess,
OSStatus error = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess,
sizeof(kPSNOfSystemProcess), &targetDesc);
if (error != noErr)