sunchb / cson Goto Github PK
View Code? Open in Web Editor NEWTransformation between JSON and struct. (类似Java Gson,C语言实现将json和struct的快捷转换。)
License: MIT License
Transformation between JSON and struct. (类似Java Gson,C语言实现将json和struct的快捷转换。)
License: MIT License
谢谢作者提供这么好的代码,想问下是不是现在不能解析字符串数组,
在测试test1.c时出现错误
!!!!parse error on field:strList, cod=-3!!!!
decode ret=0
当解析如下的json文件时,出现Segmentation
{ "songList":[ { "cmd": { "offset": 14, "len": 1, "bit_index": 0 }, "status": { "offset": 10, "len": 1 } }, { "status": { "offset": 10, "len": 1 } } ] }
区别在于,数组对象中,其中有一个缺少cmd对象,不完整,在某些场景下会存在的情况。
分析代码是段在了parseJsonObjectDefault 521行判断处
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000000402f61 in parseJsonObjectDefault ()
附件是我根据错误修改的,看下是否正确?
有一个想法,如果提供一个根据json数据自动生成结构体和反射函数的接口,对于那些动辄几十个甚至几百个KV的json转结构体,是很必要的。手动构建这些结构体,将是一个体力活。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.