From 89ba236527d042e01be781051f8c877274e0b4e7 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 28 Nov 2023 10:43:04 -0800 Subject: [PATCH] update enum code casting --- source/mqtt/Mqtt5Packets.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/mqtt/Mqtt5Packets.cpp b/source/mqtt/Mqtt5Packets.cpp index a36fde94d..6c61e656f 100644 --- a/source/mqtt/Mqtt5Packets.cpp +++ b/source/mqtt/Mqtt5Packets.cpp @@ -812,7 +812,7 @@ namespace Aws Allocator * /*allocator*/) noexcept { m_sessionPresent = packet.session_present; - m_reasonCode = (enum ConnectReasonCode)packet.reason_code; + m_reasonCode = (ConnectReasonCode)packet.reason_code; setPacketOptional(m_sessionExpiryIntervalSec, packet.session_expiry_interval); setPacketOptional(m_receiveMaximum, packet.receive_maximum); setPacketOptional(m_maximumQOS, (QOS*)packet.maximum_qos); @@ -1074,7 +1074,7 @@ namespace Aws setUserProperties(m_userProperties, packet.user_properties, packet.user_property_count); for (size_t i = 0; i < packet.reason_code_count; i++) { - m_reasonCodes.push_back(*((enum SubAckReasonCode*)(packet.reason_codes + i))); + m_reasonCodes.push_back(*((SubAckReasonCode*)(packet.reason_codes + i))); } } @@ -1160,7 +1160,7 @@ namespace Aws for (size_t i = 0; i < packet.reason_code_count; i++) { - m_reasonCodes.push_back(*(enum UnSubAckReasonCode*)(packet.reason_codes + i)); + m_reasonCodes.push_back(*(UnSubAckReasonCode*)(packet.reason_codes + i)); } setUserProperties(m_userProperties, packet.user_properties, packet.user_property_count); } @@ -1186,7 +1186,7 @@ namespace Aws { (void)allocator; - m_maximumQOS = (enum QOS)negotiated_settings.maximum_qos; + m_maximumQOS = (QOS)negotiated_settings.maximum_qos; m_sessionExpiryIntervalSec = negotiated_settings.session_expiry_interval; m_receiveMaximumFromServer = negotiated_settings.receive_maximum_from_server;