From 67a289cc40e2d431ab0daf112d39a9de5b7e8949 Mon Sep 17 00:00:00 2001 From: Slavey Karadzhov Date: Tue, 6 Nov 2018 07:56:03 +0100 Subject: [PATCH] Fixes to issues reported from codacy --- Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp | 2 +- Sming/SmingCore/Network/WebsocketClient.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp index 73dcc80396..683fa5ac51 100644 --- a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp +++ b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp @@ -45,7 +45,7 @@ int WebsocketResource::checkHeaders(HttpServerConnection& connection, HttpReques void WebsocketResource::shutdown(HttpServerConnection& connection) { - WebsocketConnection* socket = (WebsocketConnection*)connection.userData; + WebsocketConnection* socket = static_cast(connection.userData); delete socket; connection.userData = NULL; connection.setTimeOut(1); diff --git a/Sming/SmingCore/Network/WebsocketClient.cpp b/Sming/SmingCore/Network/WebsocketClient.cpp index 26e790427b..d857c73de8 100644 --- a/Sming/SmingCore/Network/WebsocketClient.cpp +++ b/Sming/SmingCore/Network/WebsocketClient.cpp @@ -32,7 +32,7 @@ WebsocketClient::~WebsocketClient() HttpConnection* WebsocketClient::getHttpConnection() { - HttpConnection* connection = (HttpConnection*)WebsocketConnection::getConnection(); + HttpConnection* connection = static_cast(WebsocketConnection::getConnection()); if(!connection && state == eWSCS_Closed) { connection = new HttpConnection(new RequestQueue()); setConnection(connection);