|
|
| version 1.1, 2010/08/31 12:59:43 | version 1.3, 2010/09/07 23:06:15 |
|---|---|
| Line 74 SOFTWARE. | Line 74 SOFTWARE. |
| #include "JSON_parser.h" | #include "JSON_parser.h" |
| #include "pa_memory.h" | |
| #ifdef _MSC_VER | #ifdef _MSC_VER |
| # if _MSC_VER >= 1400 /* Visual Studio 2005 and up */ | # if _MSC_VER >= 1400 /* Visual Studio 2005 and up */ |
| # pragma warning(disable:4996) // unsecure sscanf | # pragma warning(disable:4996) // unsecure sscanf |
| Line 95 SOFTWARE. | Line 97 SOFTWARE. |
| # define JSON_PARSER_PARSE_BUFFER_SIZE 3500 | # define JSON_PARSER_PARSE_BUFFER_SIZE 3500 |
| #endif | #endif |
| #ifdef JSON_PARSER_DEBUG_MALLOC | #define JSON_parser_malloc(bytes, reason) pa_malloc(bytes) |
| # define JSON_parser_malloc JSON_parser_debug_malloc | #define JSON_parser_free(ptr) pa_free(ptr) |
| # define JSON_parser_free JSON_parser_debug_free | |
| #else | |
| # define JSON_parser_malloc(bytes, reason) malloc(bytes) | |
| # define JSON_parser_free free | |
| #endif | |
| extern void* JSON_parser_debug_malloc(size_t bytes, const char* reason); | |
| extern void JSON_parser_debug_free(void*); | |
| typedef unsigned short UTF16; | typedef unsigned short UTF16; |
| Line 455 new_JSON_parser(JSON_config* config) | Line 449 new_JSON_parser(JSON_config* config) |
| int depth = 0; | int depth = 0; |
| JSON_config default_config; | JSON_config default_config; |
| JSON_parser jc = JSON_parser_malloc(sizeof(struct JSON_parser_struct), "parser"); | JSON_parser jc = (JSON_parser)JSON_parser_malloc(sizeof(struct JSON_parser_struct), "parser"); |
| if (jc == NULL) { | if (jc == NULL) { |
| return NULL; | return NULL; |