From nobody Mon Feb 9 13:57:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579439101; cv=none; d=zohomail.com; s=zohoarc; b=nlRtHcM+mYRbd/wk2iwOzZXg20snIifygMOnuNH4Fc/yUk6ImfH5QCsjlosNOAeAvKz05yXy1qk26m5yGuQgI2kg/eaRJvFbiVbTSLbwqQjUA2UgVDR7PjJAgZYtGncNBA2RRY/Pe7UuJHtKFyBgwr0Ad/yYkmhfVkYxhkYjpuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579439101; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JwdM6c9X9PtZFXD1kJdrwFZDzNvcN7tBxQcOtonNdaY=; b=K4DPsE70WGCcZP5aPfdHn7/03FJu3nVdmigzpwDbjkGKtNIU+cjjENxrm+UckfYJko9R1dmn+rfaj5Zo0lMc3xFndM0nvUgLfK17PJ3toIFiCMXFqWfkymieWvkDJoHNazppj7xbkEsrxe1p8vY7ynFEB+KzXKeQniDlv5Yr8ac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579439101110262.4573688676403; Sun, 19 Jan 2020 05:05:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-d-MbEBw_PlCX9IjYeZveYA-1; Sun, 19 Jan 2020 08:04:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0DBC185432C; Sun, 19 Jan 2020 13:04:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 931BC1084393; Sun, 19 Jan 2020 13:04:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1C1141802029; Sun, 19 Jan 2020 13:04:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00JD4I2f001285 for ; Sun, 19 Jan 2020 08:04:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 29C0089E7B; Sun, 19 Jan 2020 13:04:18 +0000 (UTC) Received: from foo.home.annexia.org (ovpn-117-237.ams2.redhat.com [10.36.117.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F5C289D17; Sun, 19 Jan 2020 13:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579439100; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JwdM6c9X9PtZFXD1kJdrwFZDzNvcN7tBxQcOtonNdaY=; b=AHJ3yH0HxzWi2Qw3fcDB6wjCJX7dI9fli/MrNLPWgv5CZqt4oo5NvxEZ4UywjyyedqCYQn IsSZvvvGVOW8o8BhwzKLHUHgGAExEfjv+TR0DE0jbpEa/VmKBxSKoFFDQboXutfsnCc3UL dKctvOffk6pBVF+iJMkHgbQsk6YVGoY= From: "Richard W.M. Jones" To: libvir-list@redhat.com Subject: [PATCH ocaml 2/3] String_val returns const char * in OCaml 4.10. Date: Sun, 19 Jan 2020 13:04:09 +0000 Message-Id: <20200119130410.3348835-3-rjones@redhat.com> In-Reply-To: <20200119130410.3348835-1-rjones@redhat.com> References: <20200119130410.3348835-1-rjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: ptoscano@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: d-MbEBw_PlCX9IjYeZveYA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This should be compatible with earlier versions of OCaml too since we are just assigning a char * to a const char *. --- libvirt/generator.pl | 14 +++++++------- libvirt/libvirt_c_oneoffs.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libvirt/generator.pl b/libvirt/generator.pl index ac3dd65..aff371b 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -593,7 +593,7 @@ sub gen_c_code } elsif ($sig =3D~ /^(\w+), string : unit$/) { "\ " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); int r; =20 NONBLOCKING (r =3D $c_name ($1, str)); @@ -605,7 +605,7 @@ sub gen_c_code "\ CAMLlocal1 (rv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); int r; =20 NONBLOCKING (r =3D $c_name ($1, str, 0)); @@ -618,7 +618,7 @@ sub gen_c_code "\ CAMLlocal1 (rv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); $c_ret_type r; =20 NONBLOCKING (r =3D $c_name ($1, str)); @@ -633,7 +633,7 @@ sub gen_c_code "\ CAMLlocal1 (rv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); $c_ret_type r; =20 NONBLOCKING (r =3D $c_name ($1, str, 0)); @@ -648,7 +648,7 @@ sub gen_c_code "\ CAMLlocal1 (rv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); unsigned int u =3D Int_val (uv); $c_ret_type r; =20 @@ -735,7 +735,7 @@ sub gen_c_code "\ CAMLlocal2 (rv, connv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); $c_ret_type r; =20 NONBLOCKING (r =3D $c_name ($1, str)); @@ -751,7 +751,7 @@ sub gen_c_code "\ CAMLlocal2 (rv, connv); " . gen_unpack_args ($1) . " - char *str =3D String_val (strv); + const char *str =3D String_val (strv); $c_ret_type r; =20 NONBLOCKING (r =3D $c_name ($1, str, 0)); diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c index 8468c73..fc2ac13 100644 --- a/libvirt/libvirt_c_oneoffs.c +++ b/libvirt/libvirt_c_oneoffs.c @@ -601,7 +601,7 @@ ocaml_libvirt_domain_set_scheduler_parameters (value do= mv, value paramsv) int nparams =3D Wosize_val (paramsv); virSchedParameterPtr params; int r, i; - char *name; + const char *name; =20 params =3D malloc (sizeof (*params) * nparams); if (params =3D=3D NULL) @@ -1005,7 +1005,7 @@ ocaml_libvirt_domain_block_stats (value domv, value p= athv) CAMLparam2 (domv, pathv); CAMLlocal2 (rv,v); virDomainPtr dom =3D Domain_val (domv); - char *path =3D String_val (pathv); + const char *path =3D String_val (pathv); struct _virDomainBlockStats stats; int r; =20 @@ -1028,7 +1028,7 @@ ocaml_libvirt_domain_interface_stats (value domv, val= ue pathv) CAMLparam2 (domv, pathv); CAMLlocal2 (rv,v); virDomainPtr dom =3D Domain_val (domv); - char *path =3D String_val (pathv); + const char *path =3D String_val (pathv); struct _virDomainInterfaceStats stats; int r; =20 --=20 2.24.1