borne
ac1e4b1368
feat: add int64 support
...
Offering: Open Source Institute
This commit adds int64 support for cjson. To enable int64, you need to define the macro ENABLE_INT64. To make it more clear, you need to build cjson like this if you are using makefile:
mkdir build
cd build
cmake -DENABLE_INT64=ON ..
make
This implementation changed the type of valueint in struct cJSON: from int to long long(int64), and added a new flag cJSON_IsInt64.
For a int64 cJSON item, the value of item->type would be cJSON_Number | cJSON_IsInt64.
The existing functions parse_number and print_number can handle int64 now.
Considering we have added a new type cJSON_IsInt64, some new functions have been added:
CJSON_PUBLIC(long long *) cJSON_GetInt64NumberValue(cJSON * const item)
CJSON_PUBLIC(cJSON_bool) cJSON_IsInt64Number(const cJSON * const item)
CJSON_PUBLIC(cJSON *) cJSON_CreateInt64Number(long long integer)
CJSON_PUBLIC(cJSON*) cJSON_AddInt64NumberToObject(cJSON * const object, const char * const name, const long long integer)
CJSON_PUBLIC(long long) cJSON_SetInt64NumberValue(cJSON * const object, const long long integer)
And some existing functions are also adjusted for int64, including parse_number, cJSON_SetNumberHelper, print_number, cJSON_CreateNumber, cJSON_Compare and compare_json(in cJSON_Utils).
Besides the code changes, we have also added some testcases for int64.
These tests will run if ENABLE_INT64 is turned on.
Ref:PeterAlfredLee
https://github.com/DaveGamble/cJSON/pull/689
Signed-off-by: borne <bo.lu@huawei.com >
2024-06-21 13:05:42 +08:00
liubo
1a6a39119e
Description: 漏洞处理
...
IssueNo:https://gitee.com/openharmony/third_party_cJSON/issues/I8S4Y8
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: liubo419 <liubo419@huawei.com >
2023-12-28 17:40:30 +08:00
w00845693
7a7ebff009
Description: updata user guide
...
IssueNo: https://gitee.com/openharmony/third_party_cJSON/issues/I8JGFE
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: wyk99 <wangyuekai1@huawei.com >
2023-11-27 09:46:09 +08:00
huangxiaolinabc123
015ccaf9f8
modify samgr
...
Signed-off-by: huangxiaolinabc123 <huangxiaolin12@huawei.com >
Change-Id: Ida26129fe96f79d74996e6f22f6508ba4442dfb8
2022-07-30 15:25:13 +08:00
jiadexiang
036ad89d17
Description: update version to v1.7.15
...
IssueNo:I5CE1Z
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: jiadexiang <jiadexiang@huawei.com >
2022-06-15 15:04:36 +08:00
jiadexiang
9bf49c789e
Description: fix OAT by updating BUILD.gn
...
IssueNo:I44MMZ
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: jiadexiang <jiadexiang@huawei.com >
2021-08-09 21:15:36 +08:00
mamingshuai
a006830083
update openharmony 1.0.1
2021-03-11 20:34:23 +08:00
wenjun
2c251595b3
add OpenHarmony 1.0 baseline
2020-09-09 09:26:41 +08:00
l00495960
4e7d233e82
Merge tag 'v1.7.13' into hmf merge by version tool
2020-05-20 16:26:38 +08:00
p00452466
1629628a2c
TicketNo:DTS2020022300682
...
Description: foundations to foundation
Team:OTHERS
Feature or Bugfix:Bugfix
Binary Source: NA
PrivateCode(Yes/No):No
Change-Id: I6f8539ffe2c38b71e50a66d3b6ec04d0ce9ed63e
Reviewed-on: http://mgit-tm.rnd.huawei.com/8314088
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com >
Reviewed-by: zhaopeng 00380337 <zhaopeng22@huawei.com >
Reviewed-by: yangguangzhao 00471801 <yangguangzhao1@huawei.com >
2020-04-02 20:57:42 +08:00
Alan Wang
752bdb7931
Merge pull request #454 from Alanscut/float-compare
...
comparing double value with DBL_EPSILON
2020-04-02 20:09:42 +08:00
Alan Wang
8813f0097d
Merge pull request #453 from Alanscut/add-return-value
...
add return value for cJSON_AddItemTo... and cJSON_ReplaceItemxxx
2020-04-02 19:41:56 +08:00
Alan Wang
356e3017c8
Merge pull request #451 from Alanscut/20200324
...
add new function of `cJSON_SetValuestring`
2020-04-02 19:40:03 +08:00
Sang-Heon Jeon
82e2998955
Add getNumberValue function
...
* Add GetNumberValue function and testcase
Co-authored-by: Alan Wang <wp_scut@163.com >
2020-04-02 19:36:35 +08:00
caglarivriz
867826ec51
Added cJSON_ParseWithLength ( #358 )
...
Co-authored-by: Caglar Ivriz <caglar.ivriz@siemens.com >
2020-04-02 19:24:36 +08:00
p00452466
87664b5ce1
TicketNo:DTS2020022300682
...
Description: foundations to foundation
Team:OTHERS
Feature or Bugfix:Bugfix
Binary Source: NA
PrivateCode(Yes/No):No
Change-Id: I589f841278c9b8debb5ca44990a438e82015d780
Reviewed-on: http://mgit-tm.rnd.huawei.com/8311152
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com >
Reviewed-by: duyadong 00434757 <duyadong1@huawei.com >
Reviewed-by: zhaopeng 00380337 <zhaopeng22@huawei.com >
2020-04-02 19:06:31 +08:00
Alanscut
02445f9e87
update testcase, fixes #433
2020-04-02 16:24:10 +08:00
Alanscut
8e56349501
update testcase
2020-04-02 11:06:47 +08:00
Alanscut
9e18bf3836
false has been redefined to cJSON_False
2020-04-01 19:19:00 +08:00
h00294133
a395ef625d
TicketNo:AR000DVODQ
...
Description:Masking the compilation differences between m-core and a-core
Team:OTHERS
Feature or Bugfix:Feature
Binary Source:NA
PrivateCode(Yes/No):No
Change-Id: I3423868a51f510f7271b547d5809852a7e8cba7f
Reviewed-on: http://mgit-tm.rnd.huawei.com/8272772
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com >
Reviewed-by: wangjuntao 00221367 <wangjuntao.wang@huawei.com >
2020-03-31 19:05:03 +08:00
d00434757
454791bc7a
TicketNo:AR000DSB8C
...
Description: Solve the compilation problem of test
Team:OTHERS
Feature or Bugfix:Feature
Binary Source:NA
PrivateCode(Yes/No):Yes
Change-Id: I744c883d21a3d19649724412435773e8cf9e4b52
Reviewed-on: http://mgit-tm.rnd.huawei.com/8231440
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com >
Reviewed-by: zhaopeng 00380337 <zhaopeng22@huawei.com >
2020-03-27 17:52:31 +08:00
Alanscut
0f7551e802
add return value for cJSON_AddItemTo...
2020-03-26 14:18:52 +08:00
Alanscut
b31955beb8
update cJSON_SetValuestring and testcase
2020-03-25 15:38:54 +08:00
Alanscut
637e5b4f0d
add testcase for cJSON_SetValuestringToObject
2020-03-24 22:28:27 +08:00
Alan Wang
581c0decbd
Improve performance of adding item to array ( #448 )
...
* use prev pointer when adding item to array
Co-authored-by: xiaomianhehe <hongshaokai@hotmail.com >
Co-authored-by: Alanscut <scut@163.com >
Date: Tue Feb 18 11:54:23 2020 +0800
* add testcase for cJSON_DeleteItemFromArray
2020-03-24 16:17:25 +08:00
Alanscut
a062c212d7
fix encode_string_as_pointer
2020-03-18 16:04:58 +08:00
h00294133
a768aff707
TicketNo:AR000DVNIO
...
Description:lite test framework
Team:OTHERS
Feature or Bugfix:Feature
Binary Source:NA
PrivateCode(Yes/No):No
Change-Id: Iaba36922f0556ca0a42b7c149e53d5e0f7eb68dd
Reviewed-on: http://mgit-tm.rnd.huawei.com/8090244
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com >
Reviewed-by: wangjuntao 00221367 <wangjuntao.wang@huawei.com >
2020-03-17 14:13:43 +08:00
Alan Wang
a7da4d9079
Revert "use prev pointer when array do adding ( #430 )"
...
This reverts commit bb610a77a3 .
2020-03-16 23:04:39 +08:00
xiaomianhehe
bb610a77a3
use prev pointer when array do adding ( #430 )
...
* use prev pointer when array do adding
2020-02-18 11:54:23 +08:00
Alanscut
48640ae474
fix double comparison
2019-12-06 17:11:12 +08:00
Alanscut
a39f830377
fix issue#327
2019-11-28 09:56:04 +08:00
Alanscut
804bfa8358
eliminate warning when compiling cJSON
2019-08-12 17:06:29 +08:00
Max Bruckner
a98ced4737
Fix infinite loop in cJSON_Minify
2019-05-16 20:01:02 +02:00
Winterreise
7c1d485eae
Add link dependency to fix tests link error when ENABLE_CJSON_UTILS is ON
2019-05-11 07:37:33 +08:00
Max Bruckner
1fe0e8996b
Rewrite cJSON_Minify, fixing buffer overflows, fixes #338
...
Also first tests for cJSON_Minify.
Thanks @bigric3 for reporting
2019-04-14 23:18:48 +02:00
Max Bruckner
50eb763a0d
Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays
2018-12-16 11:06:40 +01:00
Max Bruckner
38dd902717
Update json-patch-tests
2018-10-11 00:30:43 +02:00
Zach Hindes
6935fc5a39
Add newline to end of unity_setup.c
2018-09-17 09:10:20 -05:00
Zach Hindes
4ddd0a8ffb
Support default __stdcall calling convention on tests as well
2018-09-12 15:32:30 -05:00
Zach Hindes
a59c3c6e15
Enable build and test on Windows
2018-09-04 14:36:21 -05:00
Bob Kocisko
7500759975
json patch: adding to a subfield of a non-object now fails as expected
2018-03-22 11:10:29 -04:00
Max Bruckner
ce7ebfb3bf
add_item_to_object: Fix use-after-free when string is aliased
...
If the `string` property of the item that is added is an alias to the
`string` parameter of `add_item_to_object`, and `constant` is false,
`cJSON_strdup` would access the string after it has been freed.
Thanks @hhallen for reporting this in #248 .
2018-03-02 19:49:55 +01:00
Max Bruckner
2de0afb4cf
Tests: Test if the readme examples are working
2017-12-31 01:35:09 +01:00
Max Bruckner
fb61d64be8
cJSON_Add...ToObject: Add tests for failure conditions
2017-12-29 23:26:53 +01:00
Max Bruckner
b8b49638af
Convert cJSON_Add...ToObject macros into functions
...
These functions return the added object. Functions to add objects and
arrays have also been added.
2017-12-28 23:56:39 +01:00
Max Bruckner
28a80a4cbb
Add tests for cJSON_Add...ToObject macros
2017-12-28 22:56:57 +01:00
Max Bruckner
59f0610eca
Add overrides for BUILD_SHARED_LIBS
2017-11-28 17:16:11 +01:00
Max Bruckner
92512d5cfd
Fix tests when building as static library
2017-11-28 16:44:24 +01:00
Max Bruckner
8292519a9d
Update Unity to 2.4.3
2017-11-28 03:15:50 +01:00
Max Bruckner
fabf89b60d
Add cJSON_Create{Array,Object}Reference
2017-11-28 03:06:02 +01:00