Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
0c651896
Commit
0c651896
authored
Nov 04, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix level 4 warnings under VS
parent
0c060cf3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
8 deletions
+18
-8
fast_istostr.h
include/spdlog/details/fast_istostr.h
+5
-5
fast_oss.h
include/spdlog/details/fast_oss.h
+1
-1
file_helper.h
include/spdlog/details/file_helper.h
+1
-0
os.h
include/spdlog/details/os.h
+1
-0
pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+8
-2
registry.h
include/spdlog/details/registry.h
+1
-0
formatter.h
include/spdlog/formatter.h
+1
-0
No files found.
include/spdlog/details/fast_istostr.h
View file @
0c651896
...
...
@@ -49,7 +49,7 @@ const char digit_pairs[201] =
};
inline
std
::
string
&
fast_itostr
(
int
n
,
std
::
string
&
s
,
in
t
padding
)
inline
std
::
string
&
fast_itostr
(
int
n
,
std
::
string
&
s
,
size_
t
padding
)
{
if
(
n
==
0
)
{
...
...
@@ -58,9 +58,9 @@ inline std::string& fast_itostr(int n, std::string& s, int padding)
}
int
sign
=
-
(
n
<
0
);
unsigned
int
val
=
(
n
^
sign
)
-
sign
;
unsigned
int
val
=
static_cast
<
unsigned
int
>
((
n
^
sign
)
-
sign
)
;
in
t
size
;
size_
t
size
;
if
(
val
>=
10000
)
{
if
(
val
>=
10000000
)
...
...
@@ -111,14 +111,14 @@ inline std::string& fast_itostr(int n, std::string& s, int padding)
c
+=
size
-
1
;
while
(
val
>=
100
)
{
in
t
pos
=
val
%
100
;
size_
t
pos
=
val
%
100
;
val
/=
100
;
*
(
short
*
)(
c
-
1
)
=
*
(
short
*
)(
digit_pairs
+
2
*
pos
);
c
-=
2
;
}
while
(
val
>
0
)
{
*
c
--
=
'0'
+
(
val
%
10
);
*
c
--
=
static_cast
<
char
>
(
'0'
+
(
val
%
10
)
);
val
/=
10
;
}
...
...
include/spdlog/details/fast_oss.h
View file @
0c651896
...
...
@@ -158,7 +158,7 @@ public:
}
// put int and pad with zeroes if smalled than min_width
void
put_int
(
int
n
,
in
t
padding
)
void
put_int
(
int
n
,
size_
t
padding
)
{
std
::
string
s
;
details
::
fast_itostr
(
n
,
s
,
padding
);
...
...
include/spdlog/details/file_helper.h
View file @
0c651896
...
...
@@ -55,6 +55,7 @@ public:
_flush_countdown
(
flush_inverval
)
{};
file_helper
(
const
file_helper
&
)
=
delete
;
file_helper
&
operator
=
(
const
file_helper
&
)
=
delete
;
~
file_helper
()
{
...
...
include/spdlog/details/os.h
View file @
0c651896
...
...
@@ -134,6 +134,7 @@ inline int utc_minutes_offset(const std::tm& tm = localtime())
{
#ifdef _WIN32
(
void
)
tm
;
// avoid unused param warning
DYNAMIC_TIME_ZONE_INFORMATION
tzinfo
;
auto
rv
=
GetDynamicTimeZoneInformation
(
&
tzinfo
);
if
(
!
rv
)
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
0c651896
...
...
@@ -42,6 +42,7 @@ namespace details
class
flag_formatter
{
public
:
virtual
~
flag_formatter
()
{}
virtual
void
format
(
details
::
log_msg
&
msg
)
=
0
;
};
...
...
@@ -295,6 +296,9 @@ class T_formatter :public flag_formatter
class
z_formatter
:
public
flag_formatter
{
public
:
z_formatter
()
{}
z_formatter
(
const
z_formatter
&
)
=
delete
;
z_formatter
&
operator
=
(
const
z_formatter
&
)
=
delete
;
void
format
(
log_msg
&
msg
)
override
{
...
...
@@ -312,6 +316,8 @@ public:
private
:
log_clock
::
time_point
_last_update
;
std
::
string
_value
;
std
::
mutex
_mutex
;
std
::
string
get_value
(
const
log_msg
&
msg
)
{
int
total_minutes
=
os
::
utc_minutes_offset
(
msg
.
tm_time
);
...
...
@@ -324,7 +330,7 @@ private:
oss
.
put_int
(
m
,
2
);
return
oss
.
str
();
}
std
::
mutex
_mutex
;
};
...
...
@@ -451,7 +457,7 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
{
switch
(
flag
)
{
// logger name
// logger name
case
'n'
:
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
name_formatter
()));
break
;
...
...
include/spdlog/details/registry.h
View file @
0c651896
...
...
@@ -122,6 +122,7 @@ public:
private
:
registry
()
=
default
;
registry
(
const
registry
&
)
=
delete
;
registry
&
operator
=
(
const
registry
&
)
=
delete
;
std
::
mutex
_mutex
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
logger
>>
_loggers
;
formatter_ptr
_formatter
;
...
...
include/spdlog/formatter.h
View file @
0c651896
...
...
@@ -44,6 +44,7 @@ class pattern_formatter : public formatter
public
:
explicit
pattern_formatter
(
const
std
::
string
&
pattern
);
pattern_formatter
(
const
pattern_formatter
&
)
=
delete
;
pattern_formatter
&
operator
=
(
const
pattern_formatter
&
)
=
delete
;
void
format
(
details
::
log_msg
&
msg
)
override
;
private
:
const
std
::
string
_pattern
;
...
...
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