Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
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
spdlog
Commits
b0059b29
Commit
b0059b29
authored
Jul 20, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #761
parent
9cbdd5ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
26 deletions
+27
-26
include/spdlog/details/fmt_helper.h
include/spdlog/details/fmt_helper.h
+6
-6
include/spdlog/details/thread_pool.h
include/spdlog/details/thread_pool.h
+21
-20
No files found.
include/spdlog/details/fmt_helper.h
View file @
b0059b29
...
...
@@ -51,14 +51,14 @@ inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
}
if
(
n
>
9
)
// 10-99
{
dest
.
push_back
(
'0'
+
(
n
/
10
));
dest
.
push_back
(
'0'
+
(
n
%
10
));
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
/
10
));
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
%
10
));
return
;
}
if
(
n
>=
0
)
// 0-9
{
dest
.
push_back
(
'0'
);
dest
.
push_back
(
'0'
+
n
);
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
)
);
return
;
}
// negatives (unlikely, but just in case, let fmt deal with it)
...
...
@@ -76,15 +76,15 @@ inline void pad3(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
if
(
n
>
9
)
// 10-99
{
dest
.
push_back
(
'0'
);
dest
.
push_back
(
'0'
+
n
/
10
);
dest
.
push_back
(
'0'
+
n
%
10
);
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
/
10
)
);
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
%
10
)
);
return
;
}
if
(
n
>=
0
)
{
dest
.
push_back
(
'0'
);
dest
.
push_back
(
'0'
);
dest
.
push_back
(
'0'
+
n
);
dest
.
push_back
(
'0'
+
static_cast
<
char
>
(
n
)
);
return
;
}
// negatives (unlikely, but just in case let fmt deal with it)
...
...
include/spdlog/details/thread_pool.h
View file @
b0059b29
...
...
@@ -175,7 +175,9 @@ private:
void
worker_loop_
()
{
while
(
process_next_msg_
())
{};
while
(
process_next_msg_
())
{
};
}
// process next message in the queue
...
...
@@ -191,26 +193,25 @@ private:
switch
(
incoming_async_msg
.
msg_type
)
{
case
async_msg_type
:
:
flush
:
{
incoming_async_msg
.
worker_ptr
->
backend_flush_
();
return
true
;
}
case
async_msg_type
:
:
terminate
:
{
return
false
;
}
default:
{
log_msg
msg
;
incoming_async_msg
.
to_log_msg
(
msg
);
incoming_async_msg
.
worker_ptr
->
backend_log_
(
msg
);
return
true
;
}
case
async_msg_type
:
:
flush
:
{
incoming_async_msg
.
worker_ptr
->
backend_flush_
();
return
true
;
}
case
async_msg_type
:
:
terminate
:
{
return
false
;
}
default:
{
log_msg
msg
;
incoming_async_msg
.
to_log_msg
(
msg
);
incoming_async_msg
.
worker_ptr
->
backend_log_
(
msg
);
return
true
;
}
}
assert
(
false
);
return
true
;
// should not be reached
}
};
...
...
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