[PATCH 1/7] util: Make virStringHasCaseSuffix() 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 | 4 ++--
 src/util/virstring.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index cf3d9c6f03..cd781a84f9 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1248,7 +1248,7 @@ virStringHasSuffix(const char *str,
     return STREQ(str + len - suffixlen, suffix);
 }
 
-int
+bool
 virStringHasCaseSuffix(const char *str,
                        const char *suffix)
 {
@@ -1256,7 +1256,7 @@ virStringHasCaseSuffix(const char *str,
     int suffixlen = strlen(suffix);
 
     if (len < suffixlen)
-        return 0;
+        return false;
 
     return STRCASEEQ(str + len - suffixlen, suffix);
 }
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 5b127cdba4..ed2db8a3dc 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -290,8 +290,8 @@ char *virStringReplace(const char *haystack,
 
 bool virStringHasSuffix(const char *str,
                         const char *suffix);
-int virStringHasCaseSuffix(const char *str,
-                           const char *suffix);
+bool virStringHasCaseSuffix(const char *str,
+                            const char *suffix);
 int virStringStripSuffix(char *str,
                          const char *suffix) ATTRIBUTE_RETURN_CHECK;
 int virStringMatchesNameSuffix(const char *file,
-- 
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