From: Pino Toscano Date: Wed, 5 Sep 2018 16:03:13 +0000 (+0200) Subject: Make Optstring_val return const char * X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=1248a762a6aa25cf3e1e1d8f07e4b020c812a1c1;p=ocaml-libvirt.git Make Optstring_val return const char * The users just read the result, never changing it. This also fixes the build in case CAML_SAFE_STRING is defined (which makes String_val() return const char *). --- diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c index cea975a..fcbe08e 100644 --- a/libvirt/libvirt_c_epilogue.c +++ b/libvirt/libvirt_c_epilogue.c @@ -20,7 +20,7 @@ /* Please read libvirt/README file. */ -static char * +static const char * Optstring_val (value strv) { if (strv == Val_int (0)) /* None */ diff --git a/libvirt/libvirt_c_prologue.c b/libvirt/libvirt_c_prologue.c index c41e48d..dc8846f 100644 --- a/libvirt/libvirt_c_prologue.c +++ b/libvirt/libvirt_c_prologue.c @@ -20,7 +20,7 @@ /* Please read libvirt/README file. */ -static char *Optstring_val (value strv); +static const char *Optstring_val (value strv); typedef value (*Val_ptr_t) (void *); static value Val_opt (void *ptr, Val_ptr_t Val_ptr); typedef value (*Val_const_ptr_t) (const void *);