git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v8 1/2] json_writer: new routines to create data in JSON format

From
René Scharfe <l.s.r@web.de>
Date
Jun 8, 2018, 20:32 UTC
Message-ID
<515709a2-3cfe-b147-6176-ff95455e1692@web.de>
In-Reply-To
<20180607141209.24423-2-git@jeffhostetler.com>
Am 07.06.2018 um 16:12 schrieb git@jeffhostetler.com:
Show 10 quoted lines
>   Makefile                    |   2 +
>   json-writer.c               | 419 ++++++++++++++++++++++++++++++++
>   json-writer.h               | 113 +++++++++
>   t/helper/test-json-writer.c | 572 ++++++++++++++++++++++++++++++++++++++++++++
>   t/t0019-json-writer.sh      | 236 ++++++++++++++++++
>   5 files changed, 1342 insertions(+)
>   create mode 100644 json-writer.c
>   create mode 100644 json-writer.h
>   create mode 100644 t/helper/test-json-writer.c
>   create mode 100755 t/t0019-json-writer.sh

$ git grep 'static inline' '*json*' json-writer.c:static inline void indent_pretty(struct json_writer *jw) json-writer.c:static inline void begin(struct json_writer *jw, char ch_open, int pretty) json-writer.c:static inline void assert_in_object(const struct json_writer *jw, const char *key) json-writer.c:static inline void assert_in_array(const struct json_writer *jw) json-writer.c:static inline void maybe_add_comma(struct json_writer *jw) json-writer.c:static inline void fmt_double(struct json_writer *jw, int precision, json-writer.c:static inline void object_common(struct json_writer *jw, const char *key) json-writer.c:static inline void array_common(struct json_writer *jw) json-writer.c:static inline void assert_is_terminated(const struct json_writer *jw) t/helper/test-json-writer.c:static inline int scripted(int argc, const char **argv) t/helper/test-json-writer.c:static inline int my_usage(void)

Do you need all those inline keywords? I'd rather leave the decision about inlining to the compiler and (via optimization flags) the user as much as possible. Not a biggie, but the high frequency of that word made me blink..

René
Previous: Jeff HostetlerNext: Jeff Hostetler
Message 9 of 13 in “json-writer V8”
  1. 0/2 json-writer V8git@jeffhostetler.com, Jun 7, 2018
  2. 1/2 json_writer: new routines to create data in JSON formatgit@jeffhostetler.com, Jun 7, 2018
  3. Eric SunshineJun 7, 2018
  4. Jeff HostetlerJun 8, 2018
  5. René ScharfeJun 8, 2018
  6. Jeff HostetlerJun 11, 2018
  7. René ScharfeJun 8, 2018
  8. Jeff HostetlerJun 11, 2018
  9. René ScharfeJun 8, 2018
  10. Jeff HostetlerJun 11, 2018
  11. 2/2 json-writer: t0019: add perl unit testgit@jeffhostetler.com, Jun 7, 2018
  12. Eric SunshineJun 7, 2018
  13. Jeff HostetlerJun 11, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.