From c870415908403beb210ac491560678efe32e8dcf Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 30 Jan 2025 12:10:00 -0800 Subject: [PATCH] fix formatting of uint8 and int8 fields where being rendered as 'char' --- src/datafmt.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/datafmt.cpp b/src/datafmt.cpp index da7910e..dafe543 100644 --- a/src/datafmt.cpp +++ b/src/datafmt.cpp @@ -133,19 +133,22 @@ struct FmtTree { case TypeCode::Bool: strm<<(fld.as() ? "true" : "false"); return; -#define CASE(ENUM, TYPE) \ - case TypeCode::ENUM : strm<(); return - CASE(Int8, int8_t); - CASE(Int16, int16_t); - CASE(Int32, int32_t); - CASE(Int64, int64_t); - CASE(UInt8, uint8_t); - CASE(UInt16, uint16_t); - CASE(UInt32, uint32_t); - CASE(UInt64, uint64_t); - CASE(Float32, float); - CASE(Float64, double); -#undef CASE + case TypeCode::Int8: + case TypeCode::Int16: + case TypeCode::Int32: + case TypeCode::Int64: + strm<(); + return; + case TypeCode::UInt8: + case TypeCode::UInt16: + case TypeCode::UInt32: + case TypeCode::UInt64: + strm<(); + return; + case TypeCode::Float32: + case TypeCode::Float64: + strm<(); + return; case TypeCode::String: strm<<"\""<())<<"\""; return;