mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Get rid of easily removable uses of const_cast
This commit is contained in:
@@ -277,7 +277,7 @@ Error ENetConnection::dtls_server_setup(const Ref<TLSOptions> &p_options) {
|
||||
#ifdef GODOT_ENET
|
||||
ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
|
||||
ERR_FAIL_COND_V(p_options.is_null() || !p_options->is_server(), ERR_INVALID_PARAMETER);
|
||||
return enet_host_dtls_server_setup(host, const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
|
||||
return enet_host_dtls_server_setup(host, p_options.ptr()) ? FAILED : OK;
|
||||
#else
|
||||
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "ENet DTLS support not available in this build.");
|
||||
#endif
|
||||
@@ -296,7 +296,7 @@ Error ENetConnection::dtls_client_setup(const String &p_hostname, const Ref<TLSO
|
||||
#ifdef GODOT_ENET
|
||||
ERR_FAIL_NULL_V_MSG(host, ERR_UNCONFIGURED, "The ENetConnection instance isn't currently active.");
|
||||
ERR_FAIL_COND_V(p_options.is_null() || p_options->is_server(), ERR_INVALID_PARAMETER);
|
||||
return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), const_cast<TLSOptions *>(p_options.ptr())) ? FAILED : OK;
|
||||
return enet_host_dtls_client_setup(host, p_hostname.utf8().get_data(), p_options.ptr()) ? FAILED : OK;
|
||||
#else
|
||||
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "ENet DTLS support not available in this build.");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user