include: oemrouter: add std:: namespace
Add the std:: namespace to oemrouter header integers and include cstddef
for size_t. This is due to issues hit building in a different
environment.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ic1b99377a42a447409cd3ae099298fe1dd0cee02
diff --git a/include/ipmid/oemrouter.hpp b/include/ipmid/oemrouter.hpp
index e0a9f14..ef0e697 100644
--- a/include/ipmid/oemrouter.hpp
+++ b/include/ipmid/oemrouter.hpp
@@ -3,6 +3,7 @@
#include <ipmid/api.h>
#include <array>
+#include <cstddef>
#include <cstdint>
#include <functional>
#include <ipmid/iana.hpp>
@@ -10,18 +11,18 @@
namespace oem
{
-constexpr size_t groupMagicSize = 3;
+constexpr std::size_t groupMagicSize = 3;
-using Group = std::array<uint8_t, groupMagicSize>;
+using Group = std::array<std::uint8_t, groupMagicSize>;
// Handler signature includes ipmi cmd to support wildcard cmd match.
// Buffers and lengths exclude the OemGroup bytes in the IPMI message.
// dataLen supplies length of reqBuf upon call, and should be set to the
// length of replyBuf upon return - conventional in this code base.
-using Handler = std::function<ipmi_ret_t(ipmi_cmd_t, // cmd byte
- const uint8_t*, // reqBuf
- uint8_t*, // replyBuf
- size_t*)>; // dataLen
+using Handler = std::function<ipmi_ret_t(ipmi_cmd_t, // cmd byte
+ const std::uint8_t*, // reqBuf
+ std::uint8_t*, // replyBuf
+ std::size_t*)>; // dataLen
/// Router Interface class.
/// @brief Abstract Router Interface
@@ -56,7 +57,7 @@
///
/// @param[in] oeg - request buffer for IPMI command.
/// @return the OEN.
-constexpr Number toOemNumber(const uint8_t oeg[groupMagicSize])
+constexpr Number toOemNumber(const std::uint8_t oeg[groupMagicSize])
{
return (oeg[2] << 16) | (oeg[1] << 8) | oeg[0];
}
@@ -76,8 +77,9 @@
/// @return the OEM Group.
constexpr Group toOemGroup(Number oen)
{
- return Group{static_cast<uint8_t>(oen), static_cast<uint8_t>(oen >> 8),
- static_cast<uint8_t>(oen >> 16)};
+ return Group{static_cast<std::uint8_t>(oen),
+ static_cast<std::uint8_t>(oen >> 8),
+ static_cast<std::uint8_t>(oen >> 16)};
}
} // namespace oem