mllib: cast integer pointers to intptr_t as intermediate step

This make sure there is no mismatch between the size of the integer
value that Int64_val returns, and the size of the guestfs_h pointer.

This should fix the warning on 32bit environments (and thus build, when
--enable-werror is enabled).
This commit is contained in:
Pino Toscano
2017-03-29 18:54:49 +02:00
parent 12c4cc7a6b
commit c85eb443db

View File

@@ -54,7 +54,7 @@ value
guestfs_int_mllib_visit (value gv, value dirv, value fv)
{
CAMLparam3 (gv, dirv, fv);
guestfs_h *g = (guestfs_h *) Int64_val (gv);
guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gv);
struct visitor_function_wrapper_args args;
/* The dir string could move around when we call the
* visitor_function, so we have to take a full copy of it.