提交 8753865c 编写于 作者: J Ján Tomko

virjson: drop compatibility macros

Since commit 66460e32 dropped support for YAJL 1, we no longer need
these.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Acked-by: NPeter Krempa <pkrempa@redhat.com>
上级 12f3ca24
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
# include <yajl/yajl_gen.h> # include <yajl/yajl_gen.h>
# include <yajl/yajl_parse.h> # include <yajl/yajl_parse.h>
# define yajl_size_t size_t
# define VIR_YAJL_STATUS_OK(status) ((status) == yajl_status_ok)
#endif #endif
/* XXX fixme */ /* XXX fixme */
...@@ -1615,7 +1613,7 @@ virJSONParserHandleBoolean(void *ctx, ...@@ -1615,7 +1613,7 @@ virJSONParserHandleBoolean(void *ctx,
static int static int
virJSONParserHandleNumber(void *ctx, virJSONParserHandleNumber(void *ctx,
const char *s, const char *s,
yajl_size_t l) size_t l)
{ {
virJSONParserPtr parser = ctx; virJSONParserPtr parser = ctx;
char *str; char *str;
...@@ -1643,7 +1641,7 @@ virJSONParserHandleNumber(void *ctx, ...@@ -1643,7 +1641,7 @@ virJSONParserHandleNumber(void *ctx,
static int static int
virJSONParserHandleString(void *ctx, virJSONParserHandleString(void *ctx,
const unsigned char *stringVal, const unsigned char *stringVal,
yajl_size_t stringLen) size_t stringLen)
{ {
virJSONParserPtr parser = ctx; virJSONParserPtr parser = ctx;
virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal, virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal,
...@@ -1666,7 +1664,7 @@ virJSONParserHandleString(void *ctx, ...@@ -1666,7 +1664,7 @@ virJSONParserHandleString(void *ctx,
static int static int
virJSONParserHandleMapKey(void *ctx, virJSONParserHandleMapKey(void *ctx,
const unsigned char *stringVal, const unsigned char *stringVal,
yajl_size_t stringLen) size_t stringLen)
{ {
virJSONParserPtr parser = ctx; virJSONParserPtr parser = ctx;
virJSONParserStatePtr state; virJSONParserStatePtr state;
...@@ -1824,7 +1822,7 @@ virJSONValueFromString(const char *jsonstring) ...@@ -1824,7 +1822,7 @@ virJSONValueFromString(const char *jsonstring)
/* Yajl 2 is nice enough to default to rejecting trailing garbage. */ /* Yajl 2 is nice enough to default to rejecting trailing garbage. */
rc = yajl_parse(hand, (const unsigned char *)jsonstring, len); rc = yajl_parse(hand, (const unsigned char *)jsonstring, len);
if (!VIR_YAJL_STATUS_OK(rc) || if (rc != yajl_status_ok ||
yajl_complete_parse(hand) != yajl_status_ok) { yajl_complete_parse(hand) != yajl_status_ok) {
unsigned char *errstr = yajl_get_error(hand, 1, unsigned char *errstr = yajl_get_error(hand, 1,
(const unsigned char*)jsonstring, (const unsigned char*)jsonstring,
...@@ -1935,7 +1933,7 @@ virJSONValueToBuffer(virJSONValuePtr object, ...@@ -1935,7 +1933,7 @@ virJSONValueToBuffer(virJSONValuePtr object,
{ {
yajl_gen g; yajl_gen g;
const unsigned char *str; const unsigned char *str;
yajl_size_t len; size_t len;
int ret = -1; int ret = -1;
VIR_DEBUG("object=%p", object); VIR_DEBUG("object=%p", object);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册