aboutsummaryrefslogtreecommitdiff
path: root/lua/cjson/util.lua (unfollow)
Commit message (Collapse)AuthorFilesLines
2012-03-04Rename "cjson-misc" module to "cjson.util"Mark Pulford5-24/+24
2012-03-04Move cjson-misc and scripts to "lua" directoryMark Pulford3-0/+0
2012-03-04Use DISABLE_INVALID_NUMBERS on WIN32 CMake buildsMark Pulford1-7/+7
2012-03-04Fix typo in manualMark Pulford1-2/+2
2012-03-04Update cjson-misc.lua file descriptionMark Pulford1-1/+1
2012-03-04Improve performance by tracking decode ptrMark Pulford1-46/+49
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.
2012-03-04Update bench.lua to support different JSON modulesMark Pulford3-41/+62
- 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
2012-03-04Add support to USE_INTERNAL_DTOA to CMake buildMark Pulford1-7/+41
- Provide build options for USE_INTERNAL_DTOA and MULTIPLE_THREADS - Link module with Lua library under Windows
2012-03-04Limit significant digits in numbers.json to 14Mark Pulford1-6/+6
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.
2012-03-04Add error checking to dtoa locking primitivesMark Pulford1-4/+12
2012-03-04Document dtoa build optionsMark Pulford1-0/+16
2012-03-04Use internal dtoa/strtod for double conversionMark Pulford6-16/+123
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.
2012-01-03Add support for Lua 5.2 environments to lua2jsonMark Pulford1-9/+23
2012-01-03Rename encode/decode scripts to lua2json/json2luaMark Pulford2-6/+6
2012-01-03Convert common.lua into cjson-misc moduleMark Pulford5-35/+43
2012-01-02Tidy Makefile sections and commentsMark Pulford1-17/+16
2012-01-02Fix Windows TARGET modificationsMark Pulford1-3/+3
2012-01-02Fix typos (lists, hexadecimal)Mark Pulford2-9/+9
2012-01-02Update all package descriptions for consistencyMark Pulford3-9/+19
2012-01-01Add build option to disable invalid numbersMark Pulford4-16/+39
Windows MinGW doesn't convert Infinity/NaN/hexadecimal numbers. Add DISABLE_INVALID_NUMBERS build option option to disable invalid numbers.
2012-01-01Sanitise locale code, comments and documentationMark Pulford4-41/+71
2012-01-01Add Windows MinGW target to MakefileMark Pulford1-4/+12
2011-12-31Add NDEBUG to performance CFLAGSMark Pulford1-1/+1
2011-12-31Remove redundant comment from test.luaMark Pulford1-7/+0
2011-12-31Update NEWS for 1.0.5Mark Pulford1-1/+5
2011-12-31Minor code cleanupMark Pulford1-10/+12
- Sanitised arg ordering to encode functions - Commented json->tmp to explain why decode string processing uses strbuf_*_unsafe() functions.
2011-12-31Remove "update_locale" Lua functionMark Pulford2-10/+2
Only update the locale when the module is initialised. cjson.new() can be used if the locale changes part way through program execution.
2011-12-31Add option for private bufferMark Pulford1-26/+44
When encode_keep_buffer is false, a private buffer will be used. This will allow multiple encoders to run within a single Lua state.
2011-12-31Fix minor warning from Clang analyzerMark Pulford1-1/+1
2011-12-31Remove shared current_depth var from cfg structMark Pulford1-25/+17
2011-12-30Remove strbuf:die() from global symbol tableMark Pulford1-1/+1
2011-12-30Add support for Lua 5.2 and cjson.newMark Pulford8-47/+122
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.
2011-12-30Add fpconv to work around comma decimal pointsMark Pulford8-20/+206
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
2011-12-29Remove POSIX locale workaroundMark Pulford6-124/+4
2011-12-30Display success when all tests passMark Pulford1-3/+4
2011-12-29Added Netlib dtoa.c/g_fmt.c routines (20110428)Mark Pulford2-0/+4460
See "www.netlib.org/fp/changes" for details.
2011-12-26Display failed test count (test.lua)Mark Pulford1-1/+1
2011-12-26Generate git tag based version number for packagesMark Pulford1-20/+10
2011-12-24Fix typo in lua_cjson.cMark Pulford1-1/+1
2011-12-20Clarify optional args and return valuesMark Pulford1-0/+15