| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Track pointer to the current location in the JSON string, instead of
an index to the string array. Improves decode performance 1-10%.
json_next_token():
- Clean up white space handling and leave "ch" containing the current
non-whitespace character.
|
|
|
|
|
|
| |
- Select via JSON_MODULE environment variable (default "cjson")
- Custom runtime configuration can be stored in bench-MODNAME.lua
- Add run_script() to cjson-misc and update lua2cjson.lua
|
|
|
|
|
| |
- Provide build options for USE_INTERNAL_DTOA and MULTIPLE_THREADS
- Link module with Lua library under Windows
|
|
|
|
|
|
| |
The dtoa.c strtod() function slows down significantly when the number of
digits exceeds the accuracy of a "double". JSON containing excessive
digits is an unrepresentative test, limit to 14 digits.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The internal Lua CJSON dtoa/strtod routines have locale support
disabled. This avoids problems under locales with comma decimal
separators.
Build changes:
- CMake: Check for big endian architectures
- Makefile: Provide option to build with dtoa.c
Modifications to dtoa.c:
- Include locale dtoa_config.h configuration
- Rename Infinity/NaN to inf/nan to match common C libraries
- Rename strtod() -> internal_strtod() to prevent conflict with libc
function
Modifications to g_fmt.c:
- Return output string length (instead of original buffer pointer)
- Provide precision as an argument to g_fmt()
- Silence compilations warnings from vendor source
- while(a = b)
- Unused label "done:"
- Only swap to scientific notation when once the number of decimal
digits required exceeds the precision available. This matches
standard printf format %g.
- Display a "0" in front of numbers < 1.
|
|\ |
|
| |
| |
| |
| | |
See "www.netlib.org/fp/changes" for details.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Windows MinGW doesn't convert Infinity/NaN/hexadecimal numbers. Add
DISABLE_INVALID_NUMBERS build option option to disable invalid numbers.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
- Sanitised arg ordering to encode functions
- Commented json->tmp to explain why decode string processing uses
strbuf_*_unsafe() functions.
|
| |
| |
| |
| |
| |
| |
| | |
Only update the locale when the module is initialised.
cjson.new() can be used if the locale changes part way
through program execution.
|
| |
| |
| |
| |
| |
| | |
When encode_keep_buffer is false, a private buffer will be used.
This will allow multiple encoders to run within a single Lua
state.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Update all Lua scripts to use new module init style everywhere:
local json = require "cjson"
Lua CJSON does not register a global table under Lua 5.2. The global
table can be disabled under Lua 5.1 with DISABLE_CJSON_GLOBAL.
Other changes:
- Store CJSON configuration as an upvalue for each function.
- Add "cjson.new" function to create another module table with a
separate configuration.
- Add _NAME and _VERSION variables.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Create a separate buffer and translate comma <> dot before calling
strtod(), and after calling sprintf() as required.
- Add "update_locale" Lua API call and init locale on module load.
- Move sprintf format string to fpconv
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
- Fix typo (keep_encode_buffer -> encode_keep_buffer)
- Update for consistency
- Remove duplicate sparse table example
- Change manual to use horizontal item lists
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
- Remove block quotes
- Add titles
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
build-packages.sh has several advantages:
- Automatically bumps version numbers
- Builds HTML documentation on the fly
|
| |
| |
| |
| |
| |
| |
| |
| | |
Merge quirks section into:
- Build overview (locales)
- API docs
Add API section for variables.
|
| | |
|
| |
| |
| |
| |
| | |
Display failed tests, and successful/total test counts.
Use "awk" to provide a portable "ggrep -E" with context.
|