[PATCH 3/7] util: Make virStringMatchesNameSuffix() return bool

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

 



It's a predicate, so bool is the appropriate return type.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/util/virstring.c | 6 +++---
 src/util/virstring.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index e479d3194c..f669d59f58 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1279,7 +1279,7 @@ virStringStripSuffix(char *str,
     return true;
 }
 
-int
+bool
 virStringMatchesNameSuffix(const char *file,
                            const char *name,
                            const char *suffix)
@@ -1291,9 +1291,9 @@ virStringMatchesNameSuffix(const char *file,
     if (filelen == (namelen + suffixlen) &&
         STREQLEN(file, name, namelen) &&
         STREQLEN(file + namelen, suffix, suffixlen))
-        return 1;
+        return true;
     else
-        return 0;
+        return false;
 }
 
 /**
diff --git a/src/util/virstring.h b/src/util/virstring.h
index f5f1ecbe1e..1e36ac459c 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -294,9 +294,9 @@ bool virStringHasCaseSuffix(const char *str,
                             const char *suffix);
 bool virStringStripSuffix(char *str,
                           const char *suffix) ATTRIBUTE_RETURN_CHECK;
-int virStringMatchesNameSuffix(const char *file,
-                               const char *name,
-                               const char *suffix);
+bool virStringMatchesNameSuffix(const char *file,
+                                const char *name,
+                                const char *suffix);
 
 void virStringStripIPv6Brackets(char *str);
 bool virStringHasChars(const char *str,
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux