Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
44144010
Commit
44144010
authored
Aug 20, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/StringStrip: add more "nonnull" attributes
parent
ec54754e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
StringStrip.cxx
src/util/StringStrip.cxx
+1
-1
StringStrip.hxx
src/util/StringStrip.hxx
+9
-7
No files found.
src/util/StringStrip.cxx
View file @
44144010
/*
* 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
...
...
src/util/StringStrip.hxx
View file @
44144010
/*
* 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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment