From ccc61dbbc43d656faec4f3f7823c65cb20f63e47 Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Thu, 26 Jul 2018 13:24:01 +0200 Subject: [PATCH] Vendors/lmdb: fixes in OCaml stubs --- vendors/ocaml-lmdb/src/lmdb_stubs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vendors/ocaml-lmdb/src/lmdb_stubs.c b/vendors/ocaml-lmdb/src/lmdb_stubs.c index 85b479229..9461b2a7b 100644 --- a/vendors/ocaml-lmdb/src/lmdb_stubs.c +++ b/vendors/ocaml-lmdb/src/lmdb_stubs.c @@ -152,7 +152,7 @@ CAMLprim value stub_mdb_env_set_flags(value env, value flags, value onoff) { } CAMLprim value stub_mdb_env_get_flags(value env) { - int flags; + unsigned int flags; mdb_env_get_flags(Env_val(env), &flags); return Val_int(flags); } @@ -434,7 +434,10 @@ CAMLprim value stub_mdb_cursor_renew(value txn, value cursor) { } CAMLprim value stub_mdb_cursor_txn(value cursor) { - return (value) mdb_cursor_txn(Cursor_val(cursor)); + CAMLparam1(cursor); + CAMLlocal1(txn); + txn = alloc_txn(mdb_cursor_txn(Cursor_val(cursor))); + CAMLreturn(txn); } CAMLprim value stub_mdb_cursor_dbi(value cursor) {