From a1ff432bf8165d29c6f76857147f72c050006690 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 10 Aug 2016 23:58:45 -0400 Subject: [PATCH] Restore fixed-width types in string representations of lua fields e.g. tostring(df.new('int16_t')) was returning "" --- library/DataStaticsFields.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/library/DataStaticsFields.cpp b/library/DataStaticsFields.cpp index 8ff0770fc..d6a622a9e 100644 --- a/library/DataStaticsFields.cpp +++ b/library/DataStaticsFields.cpp @@ -11,23 +11,23 @@ #endif namespace df { -#define NUMBER_IDENTITY_TRAITS(category, type) \ - category##_identity identity_traits::identity(#type); -#define INTEGER_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(integer, type) -#define FLOAT_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(float, type) +#define NUMBER_IDENTITY_TRAITS(category, type, name) \ + category##_identity identity_traits::identity(name); +#define INTEGER_IDENTITY_TRAITS(type, name) NUMBER_IDENTITY_TRAITS(integer, type, name) +#define FLOAT_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(float, type, #type) #ifndef STATIC_FIELDS_GROUP - INTEGER_IDENTITY_TRAITS(char); - INTEGER_IDENTITY_TRAITS(signed char); - INTEGER_IDENTITY_TRAITS(unsigned char); - INTEGER_IDENTITY_TRAITS(short); - INTEGER_IDENTITY_TRAITS(unsigned short); - INTEGER_IDENTITY_TRAITS(int); - INTEGER_IDENTITY_TRAITS(unsigned int); - INTEGER_IDENTITY_TRAITS(long); - INTEGER_IDENTITY_TRAITS(unsigned long); - INTEGER_IDENTITY_TRAITS(long long); - INTEGER_IDENTITY_TRAITS(unsigned long long); + INTEGER_IDENTITY_TRAITS(char, "char"); + INTEGER_IDENTITY_TRAITS(signed char, "int8_t"); + INTEGER_IDENTITY_TRAITS(unsigned char, "uint8_t"); + INTEGER_IDENTITY_TRAITS(short, "int16_t"); + INTEGER_IDENTITY_TRAITS(unsigned short, "uint16_t"); + INTEGER_IDENTITY_TRAITS(int, "int32_t"); + INTEGER_IDENTITY_TRAITS(unsigned int, "uint32_t"); + INTEGER_IDENTITY_TRAITS(long, "long"); + INTEGER_IDENTITY_TRAITS(unsigned long, "unsigned long"); + INTEGER_IDENTITY_TRAITS(long long, "int64_t"); + INTEGER_IDENTITY_TRAITS(unsigned long long, "uint64_t"); FLOAT_IDENTITY_TRAITS(float); FLOAT_IDENTITY_TRAITS(double);