From nobody Thu Mar 28 16:59:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1567670402; cv=none; d=zoho.com; s=zohoarc; b=HrXHnY/EDxAXg5EPCbza1YPKTp9A9RtwRyW549P9V8HTapMmkh6qX6aA0Kz6SWlp1zu878XkRzE3Lj3dFlmiFwYeefLYAgX9WCIT2DQw29zR55Lk69cwt5c35c4hBUCtDhWfU/fwGTuPPZL5Vce8WqIFKAKlU0B0oXlDjrUrkMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567670402; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=9yR0v2U/aS18oW6VuEUo0Ub98nM/3ixyBcMTGb8hio8=; b=eIY7VDEulfM8AfHcA1MYaP/EKOkSix6nRjtCgBl0XhVCn5ts7IVVankXRSyDbdcDn35kz2jMxKvvoUGmJsz3RazzzPH455tjJ04eE2DxJldA8isJ33+yUi+owGLUlM/8YwYjDEWVcChuK+Dj4GN/bg/spyrr0/Dn56+gCzx3Mko= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567670402840715.4877961960484; Thu, 5 Sep 2019 01:00:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DCED73090FD1; Thu, 5 Sep 2019 08:00:00 +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 4C6C960126; Thu, 5 Sep 2019 07:59:59 +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 E863E1802218; Thu, 5 Sep 2019 07:59:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x857xtlR022732 for ; Thu, 5 Sep 2019 03:59:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id CBC301001959; Thu, 5 Sep 2019 07:59:55 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24C001001958; Thu, 5 Sep 2019 07:59:52 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Thu, 5 Sep 2019 09:59:48 +0200 Message-Id: <20190905075948.13299-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH] Make const the return value of caml_named_value() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 05 Sep 2019 08:00:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" With OCaml >=3D 4.09 caml_named_value() returns a const value *, so keep the constness to build also in this case. Signed-off-by: Pino Toscano --- libvirt/libvirt_c_oneoffs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c index 6f56f10..e23c0db 100644 --- a/libvirt/libvirt_c_oneoffs.c +++ b/libvirt/libvirt_c_oneoffs.c @@ -1207,7 +1207,7 @@ ocaml_libvirt_event_run_default_impl (value unitv) #define DOMAIN_CALLBACK_BEGIN(NAME) \ value connv, domv, callback_id, result; \ connv =3D domv =3D callback_id =3D result =3D Val_int(0); \ - static value *callback =3D NULL; \ + static const value *callback =3D NULL; \ caml_leave_blocking_section(); \ if (callback =3D=3D NULL) \ callback =3D caml_named_value(NAME); \ @@ -1433,7 +1433,7 @@ timeout_callback(int timer, void *opaque) { value callback_id, result; callback_id =3D result =3D Val_int(0); - static value *callback =3D NULL; + static const value *callback =3D NULL; caml_leave_blocking_section(); if (callback =3D=3D NULL) callback =3D caml_named_value("Libvirt.timeout_callback"); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list