Commit 45ffc864 authored by Max Kellermann's avatar Max Kellermann

util/StringCompare: add more function attributes

parent 19d9ce26
/*
* 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
......
/*
* 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;
......
/*
* 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
......
/*
* 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment