From 6805acd74f635a64761d6b021473a084da95b337 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 30 Mar 2020 00:31:25 -0400 Subject: [PATCH] Adds padding for all integer types. --- Reflection/Struct.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Reflection/Struct.cpp b/Reflection/Struct.cpp index 6597a8c63..5567172d8 100644 --- a/Reflection/Struct.cpp +++ b/Reflection/Struct.cpp @@ -9,6 +9,7 @@ #include "Struct.hpp" #include +#include #include // MARK: - Setters @@ -150,7 +151,7 @@ std::string Reflection::Struct::description() const { } // Output Ints of all sizes as hex. -#define OutputIntC(int_type, cast_type) if(*type == typeid(int_type)) { stream << std::hex << cast_type(::Reflection::get(*this, key)); continue; } +#define OutputIntC(int_type, cast_type) if(*type == typeid(int_type)) { stream << std::setfill('0') << std::setw(sizeof(int_type)*2) << std::hex << cast_type(::Reflection::get(*this, key)); continue; } #define OutputInt(int_type) OutputIntC(int_type, int_type) OutputIntC(int8_t, int16_t); OutputIntC(uint8_t, uint16_t);