X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..1c324d5b2380a68f209e65969079677dbaf1c511:/projects/stargazer/plugins/configuration/sgconfig/conn.h?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/sgconfig/conn.h b/projects/stargazer/plugins/configuration/sgconfig/conn.h index c96be90b..a98e593b 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/conn.h +++ b/projects/stargazer/plugins/configuration/sgconfig/conn.h @@ -60,7 +60,7 @@ class Conn ~Conn(); int Sock() const { return m_sock; } - uint32_t IP() const { return *(uint32_t *)(&m_addr.sin_addr); } + uint32_t IP() const { return *reinterpret_cast(&m_addr.sin_addr); } uint16_t Port() const { return ntohs(m_addr.sin_port); } std::string endpoint() const { return inet_ntostring(IP()) + ":" + std::to_string(Port()); }