[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] rangeset: "has" and "is" functions return boolean



commit c44d96190f2e9ec6306ae0327955fdf9b730730d
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jun 9 15:57:26 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jun 9 15:57:26 2015 +0200

    rangeset: "has" and "is" functions return boolean
    
    Additionally rangeset_is_empty()'s sole parameter can be const.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/common/rangeset.c      |   14 +++++++-------
 xen/include/xen/rangeset.h |   12 +++++++-----
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index 116d5dc..3148ab7 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -248,11 +248,11 @@ int rangeset_remove_range(
     return rc;
 }
 
-int rangeset_contains_range(
+bool_t rangeset_contains_range(
     struct rangeset *r, unsigned long s, unsigned long e)
 {
     struct range *x;
-    int contains;
+    bool_t contains;
 
     ASSERT(s <= e);
 
@@ -264,11 +264,11 @@ int rangeset_contains_range(
     return contains;
 }
 
-int rangeset_overlaps_range(
+bool_t rangeset_overlaps_range(
     struct rangeset *r, unsigned long s, unsigned long e)
 {
     struct range *x;
-    int overlaps;
+    bool_t overlaps;
 
     ASSERT(s <= e);
 
@@ -310,14 +310,14 @@ int rangeset_remove_singleton(
     return rangeset_remove_range(r, s, s);
 }
 
-int rangeset_contains_singleton(
+bool_t rangeset_contains_singleton(
     struct rangeset *r, unsigned long s)
 {
     return rangeset_contains_range(r, s, s);
 }
 
-int rangeset_is_empty(
-    struct rangeset *r)
+bool_t rangeset_is_empty(
+    const struct rangeset *r)
 {
     return ((r == NULL) || list_empty(&r->range_list));
 }
diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h
index 5ed6817..aa64082 100644
--- a/xen/include/xen/rangeset.h
+++ b/xen/include/xen/rangeset.h
@@ -10,6 +10,8 @@
 #ifndef __XEN_RANGESET_H__
 #define __XEN_RANGESET_H__
 
+#include <xen/types.h>
+
 struct domain;
 struct rangeset;
 
@@ -50,17 +52,17 @@ void rangeset_limit(
 #define _RANGESETF_prettyprint_hex 0
 #define RANGESETF_prettyprint_hex  (1U << _RANGESETF_prettyprint_hex)
 
-int __must_check rangeset_is_empty(
-    struct rangeset *r);
+bool_t __must_check rangeset_is_empty(
+    const struct rangeset *r);
 
 /* Add/remove/query a numeric range. */
 int __must_check rangeset_add_range(
     struct rangeset *r, unsigned long s, unsigned long e);
 int __must_check rangeset_remove_range(
     struct rangeset *r, unsigned long s, unsigned long e);
-int __must_check rangeset_contains_range(
+bool_t __must_check rangeset_contains_range(
     struct rangeset *r, unsigned long s, unsigned long e);
-int __must_check rangeset_overlaps_range(
+bool_t __must_check rangeset_overlaps_range(
     struct rangeset *r, unsigned long s, unsigned long e);
 int rangeset_report_ranges(
     struct rangeset *r, unsigned long s, unsigned long e,
@@ -71,7 +73,7 @@ int __must_check rangeset_add_singleton(
     struct rangeset *r, unsigned long s);
 int __must_check rangeset_remove_singleton(
     struct rangeset *r, unsigned long s);
-int __must_check rangeset_contains_singleton(
+bool_t __must_check rangeset_contains_singleton(
     struct rangeset *r, unsigned long s);
 
 /* swap contents */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.