summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-09-06 19:23:13 +0200
committerMax Kellermann <max@musicpd.org>2018-09-06 19:23:13 +0200
commit45ffc864c5c1186234a98199ca747e879ec3854a (patch)
tree2aa8f4d356ad7ebb85aa8aac0d44dbdc943f9129 /src/util
parent19d9ce260a70b3c9bf21f03d53f49a7cd5ebfed8 (diff)
util/StringCompare: add more function attributes
Diffstat (limited to 'src/util')
-rw-r--r--src/util/StringCompare.cxx2
-rw-r--r--src/util/StringCompare.hxx7
-rw-r--r--src/util/WStringCompare.cxx2
-rw-r--r--src/util/WStringCompare.hxx7
4 files changed, 10 insertions, 8 deletions
diff --git a/src/util/StringCompare.cxx b/src/util/StringCompare.cxx
index 7a92d75c8..22f55ea63 100644
--- a/src/util/StringCompare.cxx
+++ b/src/util/StringCompare.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2017 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2013-2018 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/util/StringCompare.hxx b/src/util/StringCompare.hxx
index 248c12daa..383943c55 100644
--- a/src/util/StringCompare.hxx
+++ b/src/util/StringCompare.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2017 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2013-2018 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -38,6 +38,7 @@
#include "WStringCompare.hxx"
#endif
+gcc_pure gcc_nonnull_all
static inline bool
StringIsEmpty(const char *string) noexcept
{
@@ -51,7 +52,7 @@ StringStartsWith(const char *haystack, StringView needle) noexcept
return StringIsEqual(haystack, needle.data, needle.size);
}
-gcc_pure
+gcc_pure gcc_nonnull_all
bool
StringEndsWith(const char *haystack, const char *needle) noexcept;
@@ -73,7 +74,7 @@ StringAfterPrefix(const char *haystack, StringView needle) noexcept
* Check if the given string ends with the specified suffix. If yes,
* returns the position of the suffix, and nullptr otherwise.
*/
-gcc_pure
+gcc_pure gcc_nonnull_all
const char *
FindStringSuffix(const char *p, const char *suffix) noexcept;
diff --git a/src/util/WStringCompare.cxx b/src/util/WStringCompare.cxx
index d5e894074..18e77b77b 100644
--- a/src/util/WStringCompare.cxx
+++ b/src/util/WStringCompare.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2017 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2013-2018 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/util/WStringCompare.hxx b/src/util/WStringCompare.hxx
index 4b646928e..056e490ac 100644
--- a/src/util/WStringCompare.hxx
+++ b/src/util/WStringCompare.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2015 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2013-2018 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -36,6 +36,7 @@
#include <wchar.h>
+gcc_pure gcc_nonnull_all
static inline bool
StringIsEmpty(const wchar_t *string) noexcept
{
@@ -49,7 +50,7 @@ StringStartsWith(const wchar_t *haystack, WStringView needle) noexcept
return StringIsEqual(haystack, needle.data, needle.size);
}
-gcc_pure
+gcc_pure gcc_nonnull_all
bool
StringEndsWith(const wchar_t *haystack, const wchar_t *needle) noexcept;
@@ -71,7 +72,7 @@ StringAfterPrefix(const wchar_t *haystack, WStringView needle) noexcept
* Check if the given string ends with the specified suffix. If yes,
* returns the position of the suffix, and nullptr otherwise.
*/
-gcc_pure
+gcc_pure gcc_nonnull_all
const wchar_t *
FindStringSuffix(const wchar_t *p, const wchar_t *suffix) noexcept;