Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
3c226c00
Commit
3c226c00
authored
May 03, 2016
by
Branislav Katreniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic cleanup: wrap local variable in switch with {}
* improves code consistency * allows to add new case at the end
parent
06e4991e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dynamic.c++
c++/src/capnp/dynamic.c++
+4
-2
No files found.
c++/src/capnp/dynamic.c++
View file @
3c226c00
...
...
@@ -563,7 +563,7 @@ void DynamicStruct::Builder::set(StructSchema::Field field, const DynamicValue::
.
set
(
value
.
as
<
AnyPointer
>
());
return
;
case
schema
:
:
Type
::
INTERFACE
:
case
schema
:
:
Type
::
INTERFACE
:
{
auto
interfaceType
=
type
.
asInterface
();
auto
capability
=
value
.
as
<
DynamicCapability
>
();
KJ_REQUIRE
(
capability
.
getSchema
().
extends
(
interfaceType
),
"Value type mismatch."
)
{
...
...
@@ -573,6 +573,7 @@ void DynamicStruct::Builder::set(StructSchema::Field field, const DynamicValue::
kj
::
mv
(
capability
.
hook
));
return
;
}
}
KJ_UNREACHABLE
;
}
...
...
@@ -742,7 +743,7 @@ void DynamicStruct::Builder::adopt(StructSchema::Field field, Orphan<DynamicValu
}
break
;
case
schema
:
:
Type
::
INTERFACE
:
case
schema
:
:
Type
::
INTERFACE
:
{
auto
interfaceType
=
type
.
asInterface
();
KJ_REQUIRE
(
orphan
.
getType
()
==
DynamicValue
::
CAPABILITY
&&
orphan
.
interfaceSchema
.
extends
(
interfaceType
),
...
...
@@ -751,6 +752,7 @@ void DynamicStruct::Builder::adopt(StructSchema::Field field, Orphan<DynamicValu
}
break
;
}
}
builder
.
getPointerField
(
slot
.
getOffset
()
*
POINTERS
).
adopt
(
kj
::
mv
(
orphan
.
builder
));
return
;
...
...
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