summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2012-08-29 07:58:24 (GMT)
committer John-Mark Bell <jmb@netsurf-browser.org>2012-08-29 07:58:24 (GMT)
commit1dee56a7494a71a73dfc83a605d02e9450bf7e25 (patch)
treeac0d0f8625171df3609b7842b63ae3056daeda76
parent797d66f3dc9bee99903ccad15c0064a4c1afc292 (diff)
downloadlibhubbub-1dee56a7494a71a73dfc83a605d02e9450bf7e25.tar.gz
libhubbub-1dee56a7494a71a73dfc83a605d02e9450bf7e25.tar.bz2
Fix up for json-c 0.10
-rw-r--r--test/tokeniser3.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/tokeniser3.c b/test/tokeniser3.c
index d61d21a..58a1f34 100644
--- a/test/tokeniser3.c
+++ b/test/tokeniser3.c
@@ -81,10 +81,9 @@ int main(int argc, char **argv)
printf("Test: %s\n",
json_object_get_string(val));
} else if (strcmp(key, "input") == 0) {
- int len;
+ int len = json_object_get_string_len(val);
ctx.input = (const uint8_t *)
- json_object_get_string_len(val,
- &len);
+ json_object_get_string(val);
ctx.input_len = len;
} else if (strcmp(key, "output") == 0) {
ctx.output = json_object_get_array(val);
@@ -170,7 +169,7 @@ void run_test(context *ctx)
params.content_model.model =
HUBBUB_CONTENT_MODEL_PCDATA;
} else {
- char *cm = json_object_get_string(
+ const char *cm = json_object_get_string(
(struct json_object *)
array_list_get_idx(ctx->content_model, i));
@@ -273,11 +272,11 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
switch (token->type) {
case HUBBUB_TOKEN_DOCTYPE:
{
- char *expname = json_object_get_string(
+ const char *expname = json_object_get_string(
array_list_get_idx(items, 1));
- char *exppub = json_object_get_string(
+ const char *exppub = json_object_get_string(
array_list_get_idx(items, 2));
- char *expsys = json_object_get_string(
+ const char *expsys = json_object_get_string(
array_list_get_idx(items, 3));
bool expquirks = !json_object_get_boolean(
array_list_get_idx(items, 4));
@@ -337,7 +336,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
break;
case HUBBUB_TOKEN_START_TAG:
{
- char *expname = json_object_get_string(
+ const char *expname = json_object_get_string(
array_list_get_idx(items, 1));
struct lh_entry *expattrs = json_object_get_object(
array_list_get_idx(items, 2))->head;
@@ -371,7 +370,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
for (i = 0; i < token->data.tag.n_attributes; i++) {
char *expname = (char *) expattrs->k;
- char *expval = json_object_get_string(
+ const char *expval = json_object_get_string(
(struct json_object *) expattrs->v);
const char *gotname = (const char *)
token->data.tag.attributes[i].name.ptr;
@@ -400,7 +399,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
break;
case HUBBUB_TOKEN_END_TAG:
{
- char *expname = json_object_get_string(
+ const char *expname = json_object_get_string(
array_list_get_idx(items, 1));
const char *tagname = (const char *)
token->data.tag.name.ptr;
@@ -417,7 +416,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
break;
case HUBBUB_TOKEN_COMMENT:
{
- char *expstr = json_object_get_string(
+ const char *expstr = json_object_get_string(
array_list_get_idx(items, 1));
const char *gotstr = (const char *)
token->data.comment.ptr;
@@ -432,9 +431,10 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
break;
case HUBBUB_TOKEN_CHARACTER:
{
- int expstrlen;
- char *expstr = json_object_get_string_len(
- array_list_get_idx(items, 1), &expstrlen);
+ int expstrlen = json_object_get_string_len(
+ array_list_get_idx(items, 1));
+ const char *expstr = json_object_get_string(
+ array_list_get_idx(items, 1));
const char *gotstr = (const char *)
token->data.character.ptr;
size_t len = min(token->data.character.len,