Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
8ff7d76e
"...composable_kernel_rocm.git" did not exist on "17ed368f5882dc71f70511bef86ce0831fd12f4d"
Commit
8ff7d76e
authored
Dec 03, 2016
by
Raul Tambre
Committed by
Jesse Beder
Dec 03, 2016
Browse files
Fix compiler warnings about truncations.
parent
2b58c9bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
src/emitterstate.cpp
src/emitterstate.cpp
+5
-5
src/emitterstate.h
src/emitterstate.h
+11
-11
No files found.
src/emitterstate.cpp
View file @
8ff7d76e
...
@@ -124,7 +124,7 @@ void EmitterState::StartedScalar() {
...
@@ -124,7 +124,7 @@ void EmitterState::StartedScalar() {
void
EmitterState
::
StartedGroup
(
GroupType
::
value
type
)
{
void
EmitterState
::
StartedGroup
(
GroupType
::
value
type
)
{
StartedNode
();
StartedNode
();
const
in
t
lastGroupIndent
=
(
m_groups
.
empty
()
?
0
:
m_groups
.
back
()
->
indent
);
const
std
::
size_
t
lastGroupIndent
=
(
m_groups
.
empty
()
?
0
:
m_groups
.
back
()
->
indent
);
m_curIndent
+=
lastGroupIndent
;
m_curIndent
+=
lastGroupIndent
;
// TODO: Create move constructors for settings types to simplify transfer
// TODO: Create move constructors for settings types to simplify transfer
...
@@ -193,7 +193,7 @@ FlowType::value EmitterState::CurGroupFlowType() const {
...
@@ -193,7 +193,7 @@ FlowType::value EmitterState::CurGroupFlowType() const {
return
m_groups
.
empty
()
?
FlowType
::
NoType
:
m_groups
.
back
()
->
flowType
;
return
m_groups
.
empty
()
?
FlowType
::
NoType
:
m_groups
.
back
()
->
flowType
;
}
}
in
t
EmitterState
::
CurGroupIndent
()
const
{
std
::
size_
t
EmitterState
::
CurGroupIndent
()
const
{
return
m_groups
.
empty
()
?
0
:
m_groups
.
back
()
->
indent
;
return
m_groups
.
empty
()
?
0
:
m_groups
.
back
()
->
indent
;
}
}
...
@@ -205,7 +205,7 @@ bool EmitterState::CurGroupLongKey() const {
...
@@ -205,7 +205,7 @@ bool EmitterState::CurGroupLongKey() const {
return
m_groups
.
empty
()
?
false
:
m_groups
.
back
()
->
longKey
;
return
m_groups
.
empty
()
?
false
:
m_groups
.
back
()
->
longKey
;
}
}
in
t
EmitterState
::
LastIndent
()
const
{
std
::
size_
t
EmitterState
::
LastIndent
()
const
{
if
(
m_groups
.
size
()
<=
1
)
{
if
(
m_groups
.
size
()
<=
1
)
{
return
0
;
return
0
;
}
}
...
@@ -347,14 +347,14 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
...
@@ -347,14 +347,14 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
}
}
}
}
bool
EmitterState
::
SetFloatPrecision
(
in
t
value
,
FmtScope
::
value
scope
)
{
bool
EmitterState
::
SetFloatPrecision
(
std
::
size_
t
value
,
FmtScope
::
value
scope
)
{
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
float
>::
digits10
+
1
)
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
float
>::
digits10
+
1
)
return
false
;
return
false
;
_Set
(
m_floatPrecision
,
value
,
scope
);
_Set
(
m_floatPrecision
,
value
,
scope
);
return
true
;
return
true
;
}
}
bool
EmitterState
::
SetDoublePrecision
(
in
t
value
,
FmtScope
::
value
scope
)
{
bool
EmitterState
::
SetDoublePrecision
(
std
::
size_
t
value
,
FmtScope
::
value
scope
)
{
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
double
>::
digits10
+
1
)
if
(
value
<
0
||
value
>
std
::
numeric_limits
<
double
>::
digits10
+
1
)
return
false
;
return
false
;
_Set
(
m_doublePrecision
,
value
,
scope
);
_Set
(
m_doublePrecision
,
value
,
scope
);
...
...
src/emitterstate.h
View file @
8ff7d76e
...
@@ -58,12 +58,12 @@ class EmitterState {
...
@@ -58,12 +58,12 @@ class EmitterState {
GroupType
::
value
CurGroupType
()
const
;
GroupType
::
value
CurGroupType
()
const
;
FlowType
::
value
CurGroupFlowType
()
const
;
FlowType
::
value
CurGroupFlowType
()
const
;
in
t
CurGroupIndent
()
const
;
std
::
size_
t
CurGroupIndent
()
const
;
std
::
size_t
CurGroupChildCount
()
const
;
std
::
size_t
CurGroupChildCount
()
const
;
bool
CurGroupLongKey
()
const
;
bool
CurGroupLongKey
()
const
;
in
t
LastIndent
()
const
;
std
::
size_
t
LastIndent
()
const
;
in
t
CurIndent
()
const
{
return
m_curIndent
;
}
std
::
size_
t
CurIndent
()
const
{
return
m_curIndent
;
}
bool
HasAnchor
()
const
{
return
m_hasAnchor
;
}
bool
HasAnchor
()
const
{
return
m_hasAnchor
;
}
bool
HasTag
()
const
{
return
m_hasTag
;
}
bool
HasTag
()
const
{
return
m_hasTag
;
}
bool
HasBegunNode
()
const
{
bool
HasBegunNode
()
const
{
...
@@ -95,12 +95,12 @@ class EmitterState {
...
@@ -95,12 +95,12 @@ class EmitterState {
EMITTER_MANIP
GetIntFormat
()
const
{
return
m_intFmt
.
get
();
}
EMITTER_MANIP
GetIntFormat
()
const
{
return
m_intFmt
.
get
();
}
bool
SetIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
bool
SetIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
in
t
GetIndent
()
const
{
return
m_indent
.
get
();
}
std
::
size_
t
GetIndent
()
const
{
return
m_indent
.
get
();
}
bool
SetPreCommentIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
bool
SetPreCommentIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
in
t
GetPreCommentIndent
()
const
{
return
m_preCommentIndent
.
get
();
}
std
::
size_
t
GetPreCommentIndent
()
const
{
return
m_preCommentIndent
.
get
();
}
bool
SetPostCommentIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
bool
SetPostCommentIndent
(
std
::
size_t
value
,
FmtScope
::
value
scope
);
in
t
GetPostCommentIndent
()
const
{
return
m_postCommentIndent
.
get
();
}
std
::
size_
t
GetPostCommentIndent
()
const
{
return
m_postCommentIndent
.
get
();
}
bool
SetFlowType
(
GroupType
::
value
groupType
,
EMITTER_MANIP
value
,
bool
SetFlowType
(
GroupType
::
value
groupType
,
EMITTER_MANIP
value
,
FmtScope
::
value
scope
);
FmtScope
::
value
scope
);
...
@@ -109,9 +109,9 @@ class EmitterState {
...
@@ -109,9 +109,9 @@ class EmitterState {
bool
SetMapKeyFormat
(
EMITTER_MANIP
value
,
FmtScope
::
value
scope
);
bool
SetMapKeyFormat
(
EMITTER_MANIP
value
,
FmtScope
::
value
scope
);
EMITTER_MANIP
GetMapKeyFormat
()
const
{
return
m_mapKeyFmt
.
get
();
}
EMITTER_MANIP
GetMapKeyFormat
()
const
{
return
m_mapKeyFmt
.
get
();
}
bool
SetFloatPrecision
(
in
t
value
,
FmtScope
::
value
scope
);
bool
SetFloatPrecision
(
std
::
size_
t
value
,
FmtScope
::
value
scope
);
std
::
size_t
GetFloatPrecision
()
const
{
return
m_floatPrecision
.
get
();
}
std
::
size_t
GetFloatPrecision
()
const
{
return
m_floatPrecision
.
get
();
}
bool
SetDoublePrecision
(
in
t
value
,
FmtScope
::
value
scope
);
bool
SetDoublePrecision
(
std
::
size_
t
value
,
FmtScope
::
value
scope
);
std
::
size_t
GetDoublePrecision
()
const
{
return
m_doublePrecision
.
get
();
}
std
::
size_t
GetDoublePrecision
()
const
{
return
m_doublePrecision
.
get
();
}
private:
private:
...
@@ -137,8 +137,8 @@ class EmitterState {
...
@@ -137,8 +137,8 @@ class EmitterState {
Setting
<
EMITTER_MANIP
>
m_seqFmt
;
Setting
<
EMITTER_MANIP
>
m_seqFmt
;
Setting
<
EMITTER_MANIP
>
m_mapFmt
;
Setting
<
EMITTER_MANIP
>
m_mapFmt
;
Setting
<
EMITTER_MANIP
>
m_mapKeyFmt
;
Setting
<
EMITTER_MANIP
>
m_mapKeyFmt
;
Setting
<
in
t
>
m_floatPrecision
;
Setting
<
std
::
size_
t
>
m_floatPrecision
;
Setting
<
in
t
>
m_doublePrecision
;
Setting
<
std
::
size_
t
>
m_doublePrecision
;
SettingChanges
m_modifiedSettings
;
SettingChanges
m_modifiedSettings
;
SettingChanges
m_globalModifiedSettings
;
SettingChanges
m_globalModifiedSettings
;
...
@@ -149,7 +149,7 @@ class EmitterState {
...
@@ -149,7 +149,7 @@ class EmitterState {
GroupType
::
value
type
;
GroupType
::
value
type
;
FlowType
::
value
flowType
;
FlowType
::
value
flowType
;
in
t
indent
;
std
::
size_
t
indent
;
std
::
size_t
childCount
;
std
::
size_t
childCount
;
bool
longKey
;
bool
longKey
;
...
...
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