Skip to content

Fix typos, macro hygiene and preprocessor mistakes - #1085

Open
prownd wants to merge 1 commit into
DaveGamble:masterfrom
prownd:fix-typos-macro-hygiene-and-preprocessor-mistakes-s01
Open

prownd wants to merge 1 commit into
DaveGamble:masterfrom
prownd:fix-typos-macro-hygiene-and-preprocessor-mistakes-s01

Conversation

@prownd

@prownd prownd commented Sep 20, 2026

Copy link
Copy Markdown
  • cJSON_Utils.c: '#ifdef GNUCC' is never defined, so the visibility pragmas around the system headers were dead code; use GNUC.
  • cJSON_Utils.c: remove duplicated <math.h> include and a stray ';;'.
  • cJSON.c: parenthesize the arguments of the fallback isnan/isinf macros and the fallback NAN definitions.
  • cJSON.h: parenthesize macro arguments of cJSON_SetNumberValue, cJSON_SetBoolValue and cJSON_ArrayForEach, so that expressions such as cJSON_SetNumberValue(flag ? a : b, x) expand correctly.
  • cJSON.c: make the internal helper cJSON_Duplicate_rec static, it was exported without being declared in cJSON.h.
  • Fix wrong/misspelled comments: UTF-8 four byte lead mask, 'to deeply', 'cinput', 'it's elements', 'Minify a strings', 'rejects to parse', RFC7386 -> RFC7396, 'overwrite and existing', 'paring numbers', 'mainfest'.

* cJSON_Utils.c: '#ifdef __GNUCC__' is never defined, so the visibility
  pragmas around the system headers were dead code; use __GNUC__.
* cJSON_Utils.c: remove duplicated <math.h> include and a stray ';;'.
* cJSON.c: parenthesize the arguments of the fallback isnan/isinf macros
  and the fallback NAN definitions.
* cJSON.h: parenthesize macro arguments of cJSON_SetNumberValue,
  cJSON_SetBoolValue and cJSON_ArrayForEach, so that expressions such as
  cJSON_SetNumberValue(flag ? a : b, x) expand correctly.
* cJSON.c: make the internal helper cJSON_Duplicate_rec static, it was
  exported without being declared in cJSON.h.
* Fix wrong/misspelled comments: UTF-8 four byte lead mask, 'to deeply',
  'cinput', 'it's elements', 'Minify a strings', 'rejects to parse',
  RFC7386 -> RFC7396, 'overwrite and existing', 'paring numbers',
  'mainfest'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant