Skip to content

Commit

Permalink
update enum code casting
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Nov 28, 2023
1 parent 5c06d91 commit 89ba236
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/mqtt/Mqtt5Packets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)));
}
}

Expand Down Expand Up @@ -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);
}
Expand All @@ -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;

Expand Down

0 comments on commit 89ba236

Please sign in to comment.