From e3cb3fb2c3e6c29d57db953099878813538281e6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 2 Sep 2022 15:47:00 +0100 Subject: [PATCH 10/12] src: Replace "noalloc" with [@@noalloc] Avoids deprecation warnings like: File "librpm.ml", line 19, characters 0-80: Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc" I have checked that this still works with RHEL 7. --- src/librpm-c.c | 2 ++ src/librpm.ml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librpm-c.c b/src/librpm-c.c index ea32926..7b2b505 100644 --- a/src/librpm-c.c +++ b/src/librpm-c.c @@ -118,6 +118,7 @@ Val_librpm (struct librpm_data *data) CAMLreturn (rpmv); } +/* NB: This is a [@@noalloc] call. */ value supermin_rpm_is_available (value unit) { @@ -130,6 +131,7 @@ supermin_rpm_version (value unit) return caml_copy_string (RPMVERSION); } +/* NB: This is a [@@noalloc] call. */ value supermin_rpm_vercmp (value av, value bv) { diff --git a/src/librpm.ml b/src/librpm.ml index c987e21..0a6c3f7 100644 --- a/src/librpm.ml +++ b/src/librpm.ml @@ -16,10 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) -external rpm_is_available : unit -> bool = "supermin_rpm_is_available" "noalloc" +external rpm_is_available : unit -> bool = "supermin_rpm_is_available" [@@noalloc] external rpm_version : unit -> string = "supermin_rpm_version" -external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" +external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" [@@noalloc] external rpm_get_arch : unit -> string = "supermin_rpm_get_arch" type t -- 2.37.3