mirror of
https://github.com/libAthena/athena.git
synced 2025-07-05 04:35:55 +00:00
Make signed YAML values export decimal
This commit is contained in:
parent
fd84808762
commit
cecbcffd96
@ -95,7 +95,7 @@ template <>
|
|||||||
inline std::unique_ptr<YAMLNode> ValToNode(const atInt8& val)
|
inline std::unique_ptr<YAMLNode> ValToNode(const atInt8& val)
|
||||||
{
|
{
|
||||||
char str[32];
|
char str[32];
|
||||||
snprintf(str, 32, "0x%02X", val);
|
snprintf(str, 32, "%d", int(val));
|
||||||
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
||||||
ret->m_scalarString = str;
|
ret->m_scalarString = str;
|
||||||
return std::unique_ptr<YAMLNode>(ret);
|
return std::unique_ptr<YAMLNode>(ret);
|
||||||
@ -127,7 +127,7 @@ template <>
|
|||||||
inline std::unique_ptr<YAMLNode> ValToNode(const atInt16& val)
|
inline std::unique_ptr<YAMLNode> ValToNode(const atInt16& val)
|
||||||
{
|
{
|
||||||
char str[32];
|
char str[32];
|
||||||
snprintf(str, 32, "0x%04X", val);
|
snprintf(str, 32, "%d", int(val));
|
||||||
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
||||||
ret->m_scalarString = str;
|
ret->m_scalarString = str;
|
||||||
return std::unique_ptr<YAMLNode>(ret);
|
return std::unique_ptr<YAMLNode>(ret);
|
||||||
@ -159,7 +159,7 @@ template <>
|
|||||||
inline std::unique_ptr<YAMLNode> ValToNode(const atInt32& val)
|
inline std::unique_ptr<YAMLNode> ValToNode(const atInt32& val)
|
||||||
{
|
{
|
||||||
char str[32];
|
char str[32];
|
||||||
snprintf(str, 32, "0x%08X", val);
|
snprintf(str, 32, "%d", int(val));
|
||||||
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
||||||
ret->m_scalarString = str;
|
ret->m_scalarString = str;
|
||||||
return std::unique_ptr<YAMLNode>(ret);
|
return std::unique_ptr<YAMLNode>(ret);
|
||||||
@ -195,7 +195,7 @@ template <>
|
|||||||
inline std::unique_ptr<YAMLNode> ValToNode(const atInt64& val)
|
inline std::unique_ptr<YAMLNode> ValToNode(const atInt64& val)
|
||||||
{
|
{
|
||||||
char str[32];
|
char str[32];
|
||||||
snprintf(str, 32, "0x%016" PRIX64, val);
|
snprintf(str, 32, "%" PRId64, val);
|
||||||
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
YAMLNode* ret = new YAMLNode(YAML_SCALAR_NODE);
|
||||||
ret->m_scalarString = str;
|
ret->m_scalarString = str;
|
||||||
return std::unique_ptr<YAMLNode>(ret);
|
return std::unique_ptr<YAMLNode>(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user