]> git.proxmox.com Git - mirror_qemu.git/commitdiff
range: Make range_compare() public
authorEric Auger <eric.auger@redhat.com>
Thu, 19 Oct 2023 13:45:11 +0000 (15:45 +0200)
committerCédric Le Goater <clg@redhat.com>
Fri, 3 Nov 2023 08:20:31 +0000 (09:20 +0100)
Let's expose range_compare() in the header so that it can be
reused outside of util/range.c

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
include/qemu/range.h
util/range.c

index 7e2b1cc447afe373695a011755dcf79a6dacf14f..aa671da143cf82470658311599ac473c837b8102 100644 (file)
@@ -217,6 +217,12 @@ static inline int ranges_overlap(uint64_t first1, uint64_t len1,
     return !(last2 < first1 || last1 < first2);
 }
 
+/*
+ * Return -1 if @a < @b, 1 @a > @b, and 0 if they touch or overlap.
+ * Both @a and @b must not be empty.
+ */
+int range_compare(Range *a, Range *b);
+
 GList *range_list_insert(GList *list, Range *data);
 
 #endif
index 098d9d2dc0b7bd791e9e6bc7d52aabaafe175c24..782cb8b21c77867864a0da1b31a3638f465d1ae6 100644 (file)
 #include "qemu/osdep.h"
 #include "qemu/range.h"
 
-/*
- * Return -1 if @a < @b, 1 @a > @b, and 0 if they touch or overlap.
- * Both @a and @b must not be empty.
- */
-static inline int range_compare(Range *a, Range *b)
+int range_compare(Range *a, Range *b)
 {
     assert(!range_is_empty(a) && !range_is_empty(b));