Move the json_min() and json_max() macros to json_util.h and mark everything else in bits.h deprecated.

Eliminate all uses of bits.h within the json-c code.
This commit is contained in:
Eric Haszlakiewicz
2014-05-03 22:29:10 -04:00
parent 1da0599e0e
commit d4e81f9ec8
7 changed files with 34 additions and 17 deletions

View File

@@ -23,7 +23,6 @@
#include <string.h>
#include <limits.h>
#include "bits.h"
#include "debug.h"
#include "printbuf.h"
#include "arraylist.h"
@@ -36,6 +35,8 @@
#include <locale.h>
#endif /* HAVE_LOCALE_H */
#define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
#if !HAVE_STRDUP && defined(_MSC_VER)
/* MSC has the version as _strdup */
# define strdup _strdup
@@ -536,7 +537,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
/* Handle a 4-byte sequence, or two sequences if a surrogate pair */
while(1) {
if(strchr(json_hex_chars, c)) {
tok->ucs_char += ((unsigned int)hexdigit(c) << ((3-tok->st_pos++)*4));
tok->ucs_char += ((unsigned int)jt_hexdigit(c) << ((3-tok->st_pos++)*4));
if(tok->st_pos == 4) {
unsigned char unescaped_utf[4];