1 Star 0 Fork 48

HKGY/libguestfs

forked from src-openEuler/libguestfs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Fix-defaut-function-compare-error.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2022-04-19 15:56 +08:00 . Fix build error
From cc4ecbe236914f9b391ecf3815008547472632f8 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 2 Mar 2021 10:39:15 +0000
Subject: [PATCH] mlstdutils/std_utils.ml: Fix for OCaml 4.12.
We were using a default function from somewhere called "compare"
instead of the actual function (Pervasives.compare / Stdlib.compare).
Since the wrong default function was used it had a different type from
what we expected:
File "std_utils.ml", line 312, characters 36-37:
312 | | (y, y') :: _ when cmp x y = 0 -> y'
Error: This expression has type int but an expression was expected of type
'weak1 list -> int
diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
index 70156d1..3cacf36 100644
--- a/common/mlstdutils/std_utils.ml
+++ b/common/mlstdutils/std_utils.ml
@@ -305,7 +305,7 @@ module List = struct
| x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
| _ -> invalid_arg "combine3"
- let rec assoc_lbl ?(cmp = compare) ~default x = function
+ let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
| [] -> default
| (y, y') :: _ when cmp x y = 0 -> y'
| _ :: ys -> assoc_lbl ~cmp ~default x ys
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hkgy/libguestfs.git
git@gitee.com:hkgy/libguestfs.git
hkgy
libguestfs
libguestfs
master

搜索帮助