Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
bb827341
Commit
bb827341
authored
Jun 18, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add FMT_FUNC where necessary
parent
64c54703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
include/fmt/format-inl.h
include/fmt/format-inl.h
+8
-7
No files found.
include/fmt/format-inl.h
View file @
bb827341
...
...
@@ -89,8 +89,8 @@ typedef void (*FormatFunc)(internal::buffer<char>&, int, string_view);
// ERANGE - buffer is not large enough to store the error message
// other - failure
// Buffer should be at least of size 1.
int
safe_strerror
(
int
error_code
,
char
*&
buffer
,
std
::
size_t
buffer_size
)
FMT_NOEXCEPT
{
FMT_FUNC
int
safe_strerror
(
int
error_code
,
char
*&
buffer
,
std
::
size_t
buffer_size
)
FMT_NOEXCEPT
{
FMT_ASSERT
(
buffer
!=
nullptr
&&
buffer_size
!=
0
,
"invalid buffer"
);
class
dispatcher
{
...
...
@@ -147,8 +147,8 @@ int safe_strerror(int error_code, char*& buffer,
return
dispatcher
(
error_code
,
buffer
,
buffer_size
).
run
();
}
void
format_error_code
(
internal
::
buffer
<
char
>&
out
,
int
error_code
,
string_view
message
)
FMT_NOEXCEPT
{
FMT_FUNC
void
format_error_code
(
internal
::
buffer
<
char
>&
out
,
int
error_code
,
string_view
message
)
FMT_NOEXCEPT
{
// Report error code making sure that the output fits into
// inline_buffer_size to avoid dynamic memory allocation and potential
// bad_alloc.
...
...
@@ -175,15 +175,16 @@ void format_error_code(internal::buffer<char>& out, int error_code,
}
// try an fwrite, FMT_THROW on failure
void
fwrite_fully
(
const
void
*
ptr
,
size_t
size
,
size_t
count
,
FILE
*
stream
)
{
FMT_FUNC
void
fwrite_fully
(
const
void
*
ptr
,
size_t
size
,
size_t
count
,
FILE
*
stream
)
{
size_t
written
=
std
::
fwrite
(
ptr
,
size
,
count
,
stream
);
if
(
written
<
count
)
{
FMT_THROW
(
system_error
(
errno
,
"cannot write to file"
));
}
}
void
report_error
(
FormatFunc
func
,
int
error_code
,
string_view
message
)
FMT_NOEXCEPT
{
FMT_FUNC
void
report_error
(
FormatFunc
func
,
int
error_code
,
string_view
message
)
FMT_NOEXCEPT
{
memory_buffer
full_message
;
func
(
full_message
,
error_code
,
message
);
// Use Writer::data instead of Writer::c_str to avoid potential memory
...
...
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