summaryrefslogtreecommitdiff
path: root/libs/libjson/src
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libjson/src')
-rw-r--r--libs/libjson/src/JSONNode.h3
-rw-r--r--libs/libjson/src/NumberToString.h6
-rw-r--r--libs/libjson/src/stdafx.cxx4
3 files changed, 7 insertions, 6 deletions
diff --git a/libs/libjson/src/JSONNode.h b/libs/libjson/src/JSONNode.h
index 21889ca903..dc69e965ab 100644
--- a/libs/libjson/src/JSONNode.h
+++ b/libs/libjson/src/JSONNode.h
@@ -48,6 +48,7 @@
foo(short); foo(unsigned short);\
foo(int); foo(unsigned int);\
foo(long); foo(unsigned long);\
+ foo(long long); foo(unsigned long long);\
foo(float); foo(double);\
foo(bool);\
foo(const json_string &);\
@@ -57,6 +58,7 @@
foo(short) const; foo(unsigned short) const;\
foo(int) const; foo(unsigned int) const;\
foo(long) const; foo(unsigned long) const;\
+ foo(long long) const; foo(unsigned long long) const;\
foo(float) const; foo(double) const;\
foo(bool) const;\
foo(const json_string &) const;\
@@ -67,6 +69,7 @@
foo(short) foo(unsigned short)\
foo(int) foo(unsigned int)\
foo(long) foo(unsigned long)\
+ foo(long long) foo(unsigned long long)\
foo(float) foo(double)
#endif
#define IMPLEMENT_FOR_ALL_TYPES(foo)\
diff --git a/libs/libjson/src/NumberToString.h b/libs/libjson/src/NumberToString.h
index a706372f92..4ecd8779c2 100644
--- a/libs/libjson/src/NumberToString.h
+++ b/libs/libjson/src/NumberToString.h
@@ -24,11 +24,11 @@ class NumberToString {
public:
template<typename T>
static json_string _itoa(T val, unsigned int size){
- long value = (long)val;
+ int64_t value = (int64_t)val;
const unsigned int digits = getlen(size);
json_auto<json_char> result(digits);
result.ptr[digits - 1] = JSON_TEXT('\0'); //null terminator
- json_char * runner = &result.ptr[digits - 2];
+ json_char *runner = &result.ptr[digits - 2];
bool negative;
//first thing, check if it's negative, if so, make it positive
@@ -58,7 +58,7 @@ public:
#ifndef JSON_LIBRARY
template<typename T>
static json_string _uitoa(T val, unsigned int size){
- unsigned long value = val;
+ uint64_t value = (uint64_t)val;
const unsigned int digits = getlen(size) - 1; //minus one because no '-' char
json_auto<json_char> result(digits);
result.ptr[digits - 1] = JSON_TEXT('\0'); //null terminator
diff --git a/libs/libjson/src/stdafx.cxx b/libs/libjson/src/stdafx.cxx
index 324814bd86..d3822a7acb 100644
--- a/libs/libjson/src/stdafx.cxx
+++ b/libs/libjson/src/stdafx.cxx
@@ -28,9 +28,7 @@ LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT_PARAM &param)
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT64_PARAM &param)
{
- char tmp[100];
- _i64toa_s(param.iValue, tmp, _countof(tmp), 10);
- json.push_back(JSONNode(param.szName, tmp));
+ json.push_back(JSONNode(param.szName, param.iValue));
return json;
}