X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=sprinter-sexp.c;h=35c007d5a25f55d7bcebae9c588b5a6d35d1a615;hp=6891ea4254f82e89b9758f0fb6921901f00377b3;hb=HEAD;hpb=040c3236afcf95bead0324a48c2e0b9cd7934993 diff --git a/sprinter-sexp.c b/sprinter-sexp.c index 6891ea42..e37cb1f9 100644 --- a/sprinter-sexp.c +++ b/sprinter-sexp.c @@ -18,6 +18,7 @@ * Author: Peter Feigl */ +#include #include #include #include @@ -161,11 +162,11 @@ sexp_keyword (struct sprinter *sp, const char *val) } static void -sexp_integer (struct sprinter *sp, int val) +sexp_integer (struct sprinter *sp, int64_t val) { struct sprinter_sexp *sps = sexp_begin_value (sp); - fprintf (sps->stream, "%d", val); + fprintf (sps->stream, "%" PRId64, val); } static void @@ -206,7 +207,7 @@ sexp_separator (struct sprinter *sp) } struct sprinter * -sprinter_sexp_create (const void *ctx, FILE *stream) +sprinter_sexp_create (notmuch_database_t *db, FILE *stream) { static const struct sprinter_sexp template = { .vtable = { @@ -226,11 +227,12 @@ sprinter_sexp_create (const void *ctx, FILE *stream) }; struct sprinter_sexp *res; - res = talloc (ctx, struct sprinter_sexp); + res = talloc (db, struct sprinter_sexp); if (! res) return NULL; *res = template; + res->vtable.notmuch = db; res->stream = stream; return &res->vtable; }