* fixed gcc/clang warnings regarding implicit numeric to enum type conversion
* fixed unnecessary implicit type casts regarding size and signedness
Co-authored-by: Toni Uhlig <Toni.Uhlig@rohde-schwarz.com>
Both `jsmntok_t` and `jsmn_parser` are declared as anonymous structures
that are typedeffed to their actual name. This forces all downstream
users of jsmn to always use the typedef name, instead of using e.g.
`struct jsmn_parser`. While this might be considered a matter of taste,
using typedefs only has the technical downside of disallowing forward
declarations. E.g. if a dependent whishes to declare a pointer to
`jsmntok_t` without actually pulling in the "jsmn.h" header, then he is
not able to do so because there is no way in C to provide a forward
declaration for typedefs to anonymous structs.
Fix this by providing names for both `jsmntok_t` and `jsmn_parser`
structures.
* add .clang-format for automated code formatting
* automatic code formatting
* move config.mk below all target to allow custom non-default build targets
* add license to the top of the file
* use correct header file guards syntax
* convert to single-header, header-only library
* update makefile to use jsmn as a header-only library
* update readme
* add changed from PR #143
* fix clang warnings
* add changes from PR #142
* add consts as per PR #134
The current test looks for success, but since there are
no surrounding {}s the test fails. Add them in and add
a test like the one that we replace but only in the
non-strict code path.
Specify the argument after JSMN_PRIMITIVE as "0" instead of 0 so
that weird things don't happen on OSX due to using it later with
`va_arg(..., char *)` in `vtokeq`.
Prior to this commit the output of deheader was:
remove <stdlib.h> from ./jsmn.c
in ./example/jsondump.c, realloc() portability requires <unistd.h>.
in ./example/simple.c, strtol() portability requires <stdlib.h>.
saw 4 files, 16 includes, 1 removable