From 1248a762a6aa25cf3e1e1d8f07e4b020c812a1c1 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 5 Sep 2018 18:03:13 +0200 Subject: [PATCH] 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 *). --- libvirt/libvirt_c_epilogue.c | 2 +- libvirt/libvirt_c_prologue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 *); -- 1.8.3.1