X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=sprinter-json.c;h=273bdeca3d736dcb16f90acdf4ee6377efb281d0;hp=c6ec857720d9e6acd0c0c4b9410afaa391249606;hb=HEAD;hpb=2f4beda434c59f9e2f5b7c32d26543bad7217ad4 diff --git a/sprinter-json.c b/sprinter-json.c index c6ec8577..502f89fb 100644 --- a/sprinter-json.c +++ b/sprinter-json.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -124,11 +125,11 @@ json_string (struct sprinter *sp, const char *val) } static void -json_integer (struct sprinter *sp, int val) +json_integer (struct sprinter *sp, int64_t val) { struct sprinter_json *spj = json_begin_value (sp); - fprintf (spj->stream, "%d", val); + fprintf (spj->stream, "%" PRId64, val); } static void @@ -171,7 +172,7 @@ json_separator (struct sprinter *sp) } struct sprinter * -sprinter_json_create (const void *ctx, FILE *stream) +sprinter_json_create (notmuch_database_t *db, FILE *stream) { static const struct sprinter_json template = { .vtable = { @@ -191,11 +192,12 @@ sprinter_json_create (const void *ctx, FILE *stream) }; struct sprinter_json *res; - res = talloc (ctx, struct sprinter_json); + res = talloc (db, struct sprinter_json); if (! res) return NULL; *res = template; + res->vtable.notmuch = db; res->stream = stream; return &res->vtable; }