summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-08-20 16:28:43 +0200
committerMax Kellermann <max@musicpd.org>2018-08-20 16:28:43 +0200
commit441440101d67b28532e2198b59c827a3affc9c11 (patch)
tree79fded70cbfa2442d5ae4930d58e16220420eabf /src
parentec54754e22602bbc18a7524b6ff07db2a4b6d095 (diff)
util/StringStrip: add more "nonnull" attributes
Diffstat (limited to 'src')
-rw-r--r--src/util/StringStrip.cxx2
-rw-r--r--src/util/StringStrip.hxx16
2 files changed, 10 insertions, 8 deletions
diff --git a/src/util/StringStrip.cxx b/src/util/StringStrip.cxx
index 295f4ef1c..27b2b567f 100644
--- a/src/util/StringStrip.cxx
+++ b/src/util/StringStrip.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2017 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2009-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/StringStrip.hxx b/src/util/StringStrip.hxx
index 033c1a05a..b56e06eaf 100644
--- a/src/util/StringStrip.hxx
+++ b/src/util/StringStrip.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2017 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2009-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,32 +38,32 @@
* Returns a pointer to the first non-whitespace character in the
* string, or to the end of the string.
*/
-gcc_pure
+gcc_pure gcc_returns_nonnull gcc_nonnull_all
const char *
StripLeft(const char *p) noexcept;
-gcc_pure
+gcc_pure gcc_returns_nonnull gcc_nonnull_all
static inline char *
StripLeft(char *p) noexcept
{
return const_cast<char *>(StripLeft((const char *)p));
}
-gcc_pure
+gcc_pure gcc_returns_nonnull gcc_nonnull_all
const char *
StripLeft(const char *p, const char *end) noexcept;
/**
* Determine the string's end as if it was stripped on the right side.
*/
-gcc_pure
+gcc_pure gcc_returns_nonnull gcc_nonnull_all
const char *
StripRight(const char *p, const char *end) noexcept;
/**
* Determine the string's end as if it was stripped on the right side.
*/
-gcc_pure
+gcc_pure gcc_returns_nonnull gcc_nonnull_all
static inline char *
StripRight(char *p, char *end) noexcept
{
@@ -75,13 +75,14 @@ StripRight(char *p, char *end) noexcept
* Determine the string's length as if it was stripped on the right
* side.
*/
-gcc_pure
+gcc_pure gcc_nonnull_all
size_t
StripRight(const char *p, size_t length) noexcept;
/**
* Strip trailing whitespace by null-terminating the string.
*/
+gcc_nonnull_all
void
StripRight(char *p) noexcept;
@@ -89,6 +90,7 @@ StripRight(char *p) noexcept;
* Skip whitespace at the beginning and terminate the string after the
* last non-whitespace character.
*/
+gcc_returns_nonnull gcc_nonnull_all
char *
Strip(char *p) noexcept;