Commit Graph

595 Commits

Author SHA1 Message Date
Max Bruckner
6ac896d8d2 cJSON_Compare: New function to compare json 2017-04-08 17:57:36 +02:00
Max Bruckner
2a25abbf2a Deduplicate code for cJSON_GetObjectItem 2017-04-08 17:57:36 +02:00
Max Bruckner
e9803341d5 simplify and rename cJSON_strcasecmp
Two NULL strings should not be considered equal for the purpose of
cJSON.
2017-04-08 17:57:36 +02:00
Max Bruckner
31400affab Contributors: Add Pawel Winogrodzki 2017-04-08 17:56:30 +02:00
Max Bruckner
6c3df7eb59 cJSON_ParseWithOpts: Fix -Wmissing-field-initializers 2017-04-08 17:56:30 +02:00
Max Bruckner
a99d254e4f License: Add other contributors 2017-04-08 17:56:29 +02:00
Max Bruckner
f0230a584f Merge pull request #139 from PawelWMS/develop_W4_fixes
Fixing all /W4 level warnings.
2017-04-08 17:56:29 +02:00
Pawel Winogrodzki
2148e3277a Renaming "min" to "cjson_min". 2017-04-08 17:56:29 +02:00
Pawel Winogrodzki
c786cd9714 Adding back "const". 2017-04-08 17:56:29 +02:00
Pawel Winogrodzki
238ceec175 Fixing all W4-level warnings. 2017-04-08 17:56:29 +02:00
Max Bruckner
6702037b68 cJSON_Delete: Improve readability 2017-04-08 17:56:28 +02:00
Max Bruckner
eb5000ba61 cJSON_strdup: improve readability 2017-04-08 17:56:28 +02:00
Max Bruckner
655c26ada1 cJSON_strcasecmp: Improve readability 2017-04-08 17:56:28 +02:00
Max Bruckner
218b0c8dcf cJSON_Print: Use reallocate if available
This can reduce worst case peak memory usage by 30% depending on the
realloc implementation.
2017-04-08 17:56:28 +02:00
Max Bruckner
281df6997c Update copyright 2017-04-08 17:56:27 +02:00
Max Bruckner
bc0bb7c224 parse_with_opts: test return_parse_end 2017-04-08 17:56:27 +02:00
Max Bruckner
56a32f9ecc Use error_position instead of error pointer internally 2017-04-08 17:56:27 +02:00
Max Bruckner
770e8263a5 tests for cJSON_ParseWithOpts 2017-04-08 17:56:27 +02:00
Max Bruckner
2683589d93 parser: Construct error pointer from buffer offset 2017-04-08 17:56:26 +02:00
Max Bruckner
c837177a56 utf16_literal_to_utf8: Support \u0000 2017-04-08 17:56:26 +02:00
Max Bruckner
80bc7652ae cJSON_ParseWithOptions: Remove end pointer 2017-04-08 17:56:26 +02:00
Max Bruckner
87a204ed0b parse_functions: Return booleans instead of pointers 2017-04-08 17:56:26 +02:00
Max Bruckner
c9739c59fd Replace strchr with switch case
This should improve performance and improve readability.
2017-04-08 17:56:25 +02:00
Max Bruckner
778a0c146f parse_string: Use parsebuffer 2017-04-08 17:56:25 +02:00
Max Bruckner
f69b109c9f parse_number: Use parse_buffer 2017-04-08 17:56:25 +02:00
Max Bruckner
fef1c45b92 parse_object: Use parse_buffer 2017-04-08 17:56:25 +02:00
Max Bruckner
033a542532 parse_array: Use parsebuffer 2017-04-08 17:56:25 +02:00
Max Bruckner
fd0320cf54 parse_value: Use parse_buffer 2017-04-08 17:56:24 +02:00
Max Bruckner
0f98214e71 parsebuffer: type and macros 2017-04-08 17:56:24 +02:00
Max Bruckner
06a2326e3b cJSON_ParseWithOpts: Use goto fail 2017-04-08 17:56:24 +02:00
Max Bruckner
11131b9ced cJSON_ParseWithOptions: Improve variable names and intent 2017-04-08 17:56:24 +02:00
Max Bruckner
99db5db9a4 Release version 1.4.6 2017-04-08 17:54:55 +02:00
Max Bruckner
bb5ab5916f Merge pull request #147 from DaveGamble/copy-paste-msvc
Fix copy pasting with MSVC
2017-04-08 17:26:02 +02:00
Max Bruckner
411c50f671 Don't redefine CJSON_EXPORT_SYMBOLS 2017-04-08 16:39:35 +02:00
Max Bruckner
ec2db50b6f dllexport symbols by default and add CJSON_IMPORT_SYMBOLS
This should fix copy pasting of the C and header files with the MSVC
compiler.
2017-04-08 15:54:14 +02:00
Max Bruckner
74d0525201 Merge pull request #146 from DaveGamble/locale-independence
Locale independence
2017-04-08 14:46:22 +02:00
Max Bruckner
3efef58c32 README: Add setlocale to caveats 2017-04-08 03:50:22 +02:00
Max Bruckner
65541b900c Update space requirements of cJSON_PrintPreallocated 2017-04-08 03:42:44 +02:00
Max Bruckner
c08f7e1d29 print_number: Make locale independent
This first prints the number into a temporary buffer and then copies the
number to the output.

A positive side effect is that cJSON no longer reserves more space for
the number in the output than is necessary.
2017-04-08 03:38:49 +02:00
Max Bruckner
71b96afc27 print_number: Fix comment (missing word 'zeroes') 2017-04-08 02:46:24 +02:00
Max Bruckner
749fefc0c4 Make parse_number locale independent 2017-04-08 02:41:36 +02:00
Max Bruckner
50b3c30dfa README: Add Caveats section 2017-04-08 02:19:27 +02:00
Max Bruckner
c784f76c77 cJSON_strdup: Use sizeof("") instead of 1 2017-04-08 01:29:19 +02:00
Max Bruckner
84237ff48e Replace sizeof('\0') with sizeof("")
Because sizeof('\0') is actually sizeof(int) not sizeof(char).
2017-04-08 01:29:19 +02:00
Max Bruckner
ab8489a851 Readme: Fix #143 item->name --> item->string 2017-04-06 09:56:23 +02:00
Max Bruckner
795c3acabe cJSON_Utils: Fix potential null pointer dereference
Found by coverity
2017-04-05 17:36:25 +02:00
Max Bruckner
2683d4d987 ensure: Fix overflow detection 2017-04-05 16:35:55 +02:00
Max Bruckner
3c1bfe125c Clarify deprecation of valueint 2017-04-02 23:24:53 +02:00
Max Bruckner
5916f70640 cJSON.h: Deprecate valueint 2017-04-01 22:56:04 +02:00
Max Bruckner
29cfc7a767 README: Get rid of valueint and do necessary checks 2017-04-01 22:24:48 +02:00