I have a question regarding "unsigned int" values. I am using the JsonParser as a library and the JSON_INT_TYPE is the default (int I guess). When executing the code below its not possible to use values above ( 2^31+1 - 2^32 -1 ) because the value is treated as an integer and not as an unsigned integer.
CDP_VTime::m_Value is declared as "unsigned int".
bool CDP_VTime::encodeJson( JSONNODE * pJsonNode ) const
bool bRet = true;
if ( pJsonNode != 0 )
LP_INFO( Logger::MODULEID_GENERAL, "CDP_VTime::encodeJson");
json_push_back( pJsonNode, json_new_i(JSON_TEXT("vtime"), (json_int_t)m_Value ));
Is the only solution here, that i redefine the JSON_INT_TYPE as an e.g. "signed long long"-value (64bit integer)?? Or are there other possibilities to treat signed/unsigned 32 bit values with the default settings of JSON_INT_TYPE ??
Thanks for any help!!
Log in to post a comment.