diff options
Diffstat (limited to 'src/modules/json/libJSON.cpp')
-rw-r--r-- | src/modules/json/libJSON.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/json/libJSON.cpp b/src/modules/json/libJSON.cpp index a84d7bf7c0..0312898299 100644 --- a/src/modules/json/libJSON.cpp +++ b/src/modules/json/libJSON.cpp @@ -195,9 +195,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. JSONNODE * json_new_b(const json_char * name, int value){ JSON_ASSERT_SAFE(name, JSON_TEXT("null name to json_new_b"), name = EMPTY_CSTRING;); #ifdef JSON_MEMORY_CALLBACKS - return MANAGER_INSERT(new(json_malloc<JSONNode>(1)) JSONNode(name, (bool)value)); + return MANAGER_INSERT(new(json_malloc<JSONNode>(1)) JSONNode(name, value != 0 )); #else - return MANAGER_INSERT(new JSONNode(name, (bool)value)); + return MANAGER_INSERT(new JSONNode(name, (bool)value)) != 0; #endif } @@ -242,7 +242,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void json_set_b(JSONNODE * node, int value){ JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_set_b"), return;); - *((JSONNode*)node) = (bool)value; + *((JSONNode*)node) = value != 0; } void json_set_n(JSONNODE * node, const JSONNODE * orig){ @@ -251,7 +251,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *((JSONNode*)node) = *((JSONNode*)orig); } - //inspectors char json_type(const JSONNODE * node){ JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_type"), return JSON_NULL;); |