Use macros instead of magic numbers in json.c

Avoid using "magic numbers" for better maintainability.