Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
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
cpp-libs
djinni
Commits
180b4ba7
Commit
180b4ba7
authored
Sep 28, 2015
by
j4cbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #133 from PSPDFKit-labs/peter/no-shadow-constructor-variables
No shadow constructor variables
parents
eacca5ca
67d8c1b9
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
72 additions
and
72 deletions
+72
-72
src/source/CppGenerator.scala
src/source/CppGenerator.scala
+2
-2
test-suite/generated-src/cpp/assorted_primitives.hpp
test-suite/generated-src/cpp/assorted_primitives.hpp
+28
-28
test-suite/generated-src/cpp/client_returned_record.hpp
test-suite/generated-src/cpp/client_returned_record.hpp
+6
-6
test-suite/generated-src/cpp/constants.hpp
test-suite/generated-src/cpp/constants.hpp
+4
-4
test-suite/generated-src/cpp/date_record.hpp
test-suite/generated-src/cpp/date_record.hpp
+2
-2
test-suite/generated-src/cpp/extern_record_with_derivings.hpp
...-suite/generated-src/cpp/extern_record_with_derivings.hpp
+4
-4
test-suite/generated-src/cpp/map_date_record.hpp
test-suite/generated-src/cpp/map_date_record.hpp
+2
-2
test-suite/generated-src/cpp/map_list_record.hpp
test-suite/generated-src/cpp/map_list_record.hpp
+2
-2
test-suite/generated-src/cpp/map_record.hpp
test-suite/generated-src/cpp/map_record.hpp
+4
-4
test-suite/generated-src/cpp/nested_collection.hpp
test-suite/generated-src/cpp/nested_collection.hpp
+2
-2
test-suite/generated-src/cpp/primitive_list.hpp
test-suite/generated-src/cpp/primitive_list.hpp
+2
-2
test-suite/generated-src/cpp/record_with_derivings.hpp
test-suite/generated-src/cpp/record_with_derivings.hpp
+4
-4
test-suite/generated-src/cpp/record_with_duration_and_derivings.hpp
.../generated-src/cpp/record_with_duration_and_derivings.hpp
+2
-2
test-suite/generated-src/cpp/record_with_nested_derivings.hpp
...-suite/generated-src/cpp/record_with_nested_derivings.hpp
+4
-4
test-suite/generated-src/cpp/set_record.hpp
test-suite/generated-src/cpp/set_record.hpp
+4
-4
No files found.
src/source/CppGenerator.scala
View file @
180b4ba7
...
...
@@ -175,9 +175,9 @@ class CppGenerator(spec: Spec) extends Generator(spec) {
// Constructor.
if
(
r
.
fields
.
nonEmpty
)
{
w
.
wl
writeAlignedCall
(
w
,
actualSelf
+
"("
,
r
.
fields
,
")"
,
f
=>
marshal
.
fieldType
(
f
.
ty
)
+
" "
+
idCpp
.
local
(
f
.
ident
))
writeAlignedCall
(
w
,
actualSelf
+
"("
,
r
.
fields
,
")"
,
f
=>
marshal
.
fieldType
(
f
.
ty
)
+
" "
+
idCpp
.
local
(
f
.
ident
)
+
"_"
)
w
.
wl
val
init
=
(
f
:
Field
)
=>
idCpp
.
field
(
f
.
ident
)
+
"(std::move("
+
idCpp
.
local
(
f
.
ident
)
+
"))"
val
init
=
(
f
:
Field
)
=>
idCpp
.
field
(
f
.
ident
)
+
"(std::move("
+
idCpp
.
local
(
f
.
ident
)
+
"
_
))"
w
.
wl
(
": "
+
init
(
r
.
fields
.
head
))
r
.
fields
.
tail
.
map
(
f
=>
", "
+
init
(
f
)).
foreach
(
w
.
wl
)
w
.
wl
(
"{}"
)
...
...
test-suite/generated-src/cpp/assorted_primitives.hpp
View file @
180b4ba7
...
...
@@ -28,34 +28,34 @@ struct AssortedPrimitives final {
friend
bool
operator
==
(
const
AssortedPrimitives
&
lhs
,
const
AssortedPrimitives
&
rhs
);
friend
bool
operator
!=
(
const
AssortedPrimitives
&
lhs
,
const
AssortedPrimitives
&
rhs
);
AssortedPrimitives
(
bool
b
,
int8_t
eight
,
int16_t
sixteen
,
int32_t
thirtytwo
,
int64_t
sixtyfour
,
float
fthirtytwo
,
double
fsixtyfour
,
std
::
experimental
::
optional
<
bool
>
o_b
,
std
::
experimental
::
optional
<
int8_t
>
o_eight
,
std
::
experimental
::
optional
<
int16_t
>
o_sixteen
,
std
::
experimental
::
optional
<
int32_t
>
o_thirtytwo
,
std
::
experimental
::
optional
<
int64_t
>
o_sixtyfour
,
std
::
experimental
::
optional
<
float
>
o_fthirtytwo
,
std
::
experimental
::
optional
<
double
>
o_fsixtyfour
)
:
b
(
std
::
move
(
b
))
,
eight
(
std
::
move
(
eight
))
,
sixteen
(
std
::
move
(
sixteen
))
,
thirtytwo
(
std
::
move
(
thirtytwo
))
,
sixtyfour
(
std
::
move
(
sixtyfour
))
,
fthirtytwo
(
std
::
move
(
fthirtytwo
))
,
fsixtyfour
(
std
::
move
(
fsixtyfour
))
,
o_b
(
std
::
move
(
o_b
))
,
o_eight
(
std
::
move
(
o_eight
))
,
o_sixteen
(
std
::
move
(
o_sixteen
))
,
o_thirtytwo
(
std
::
move
(
o_thirtytwo
))
,
o_sixtyfour
(
std
::
move
(
o_sixtyfour
))
,
o_fthirtytwo
(
std
::
move
(
o_fthirtytwo
))
,
o_fsixtyfour
(
std
::
move
(
o_fsixtyfour
))
AssortedPrimitives
(
bool
b
_
,
int8_t
eight
_
,
int16_t
sixteen
_
,
int32_t
thirtytwo
_
,
int64_t
sixtyfour
_
,
float
fthirtytwo
_
,
double
fsixtyfour
_
,
std
::
experimental
::
optional
<
bool
>
o_b
_
,
std
::
experimental
::
optional
<
int8_t
>
o_eight
_
,
std
::
experimental
::
optional
<
int16_t
>
o_sixteen
_
,
std
::
experimental
::
optional
<
int32_t
>
o_thirtytwo
_
,
std
::
experimental
::
optional
<
int64_t
>
o_sixtyfour
_
,
std
::
experimental
::
optional
<
float
>
o_fthirtytwo
_
,
std
::
experimental
::
optional
<
double
>
o_fsixtyfour
_
)
:
b
(
std
::
move
(
b
_
))
,
eight
(
std
::
move
(
eight
_
))
,
sixteen
(
std
::
move
(
sixteen
_
))
,
thirtytwo
(
std
::
move
(
thirtytwo
_
))
,
sixtyfour
(
std
::
move
(
sixtyfour
_
))
,
fthirtytwo
(
std
::
move
(
fthirtytwo
_
))
,
fsixtyfour
(
std
::
move
(
fsixtyfour
_
))
,
o_b
(
std
::
move
(
o_b
_
))
,
o_eight
(
std
::
move
(
o_eight
_
))
,
o_sixteen
(
std
::
move
(
o_sixteen
_
))
,
o_thirtytwo
(
std
::
move
(
o_thirtytwo
_
))
,
o_sixtyfour
(
std
::
move
(
o_sixtyfour
_
))
,
o_fthirtytwo
(
std
::
move
(
o_fthirtytwo
_
))
,
o_fsixtyfour
(
std
::
move
(
o_fsixtyfour
_
))
{}
};
...
...
test-suite/generated-src/cpp/client_returned_record.hpp
View file @
180b4ba7
...
...
@@ -16,12 +16,12 @@ struct ClientReturnedRecord final {
std
::
string
content
;
std
::
experimental
::
optional
<
std
::
string
>
misc
;
ClientReturnedRecord
(
int64_t
record_id
,
std
::
string
content
,
std
::
experimental
::
optional
<
std
::
string
>
misc
)
:
record_id
(
std
::
move
(
record_id
))
,
content
(
std
::
move
(
content
))
,
misc
(
std
::
move
(
misc
))
ClientReturnedRecord
(
int64_t
record_id
_
,
std
::
string
content
_
,
std
::
experimental
::
optional
<
std
::
string
>
misc
_
)
:
record_id
(
std
::
move
(
record_id
_
))
,
content
(
std
::
move
(
content
_
))
,
misc
(
std
::
move
(
misc
_
))
{}
};
...
...
test-suite/generated-src/cpp/constants.hpp
View file @
180b4ba7
...
...
@@ -41,10 +41,10 @@ struct Constants final {
int32_t
some_integer
;
std
::
string
some_string
;
Constants
(
int32_t
some_integer
,
std
::
string
some_string
)
:
some_integer
(
std
::
move
(
some_integer
))
,
some_string
(
std
::
move
(
some_string
))
Constants
(
int32_t
some_integer
_
,
std
::
string
some_string
_
)
:
some_integer
(
std
::
move
(
some_integer
_
))
,
some_string
(
std
::
move
(
some_string
_
))
{}
};
...
...
test-suite/generated-src/cpp/date_record.hpp
View file @
180b4ba7
...
...
@@ -20,8 +20,8 @@ struct DateRecord final {
friend
bool
operator
<=
(
const
DateRecord
&
lhs
,
const
DateRecord
&
rhs
);
friend
bool
operator
>=
(
const
DateRecord
&
lhs
,
const
DateRecord
&
rhs
);
DateRecord
(
std
::
chrono
::
system_clock
::
time_point
created_at
)
:
created_at
(
std
::
move
(
created_at
))
DateRecord
(
std
::
chrono
::
system_clock
::
time_point
created_at
_
)
:
created_at
(
std
::
move
(
created_at
_
))
{}
};
...
...
test-suite/generated-src/cpp/extern_record_with_derivings.hpp
View file @
180b4ba7
...
...
@@ -21,9 +21,9 @@ struct ExternRecordWithDerivings final {
friend
bool
operator
<=
(
const
ExternRecordWithDerivings
&
lhs
,
const
ExternRecordWithDerivings
&
rhs
);
friend
bool
operator
>=
(
const
ExternRecordWithDerivings
&
lhs
,
const
ExternRecordWithDerivings
&
rhs
);
ExternRecordWithDerivings
(
::
testsuite
::
RecordWithDerivings
member
,
::
testsuite
::
color
e
)
:
member
(
std
::
move
(
member
))
,
e
(
std
::
move
(
e
))
ExternRecordWithDerivings
(
::
testsuite
::
RecordWithDerivings
member
_
,
::
testsuite
::
color
e
_
)
:
member
(
std
::
move
(
member
_
))
,
e
(
std
::
move
(
e
_
))
{}
};
test-suite/generated-src/cpp/map_date_record.hpp
View file @
180b4ba7
...
...
@@ -13,8 +13,8 @@ namespace testsuite {
struct
MapDateRecord
final
{
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
dates_by_id
;
MapDateRecord
(
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
dates_by_id
)
:
dates_by_id
(
std
::
move
(
dates_by_id
))
MapDateRecord
(
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
dates_by_id
_
)
:
dates_by_id
(
std
::
move
(
dates_by_id
_
))
{}
};
...
...
test-suite/generated-src/cpp/map_list_record.hpp
View file @
180b4ba7
...
...
@@ -14,8 +14,8 @@ namespace testsuite {
struct
MapListRecord
final
{
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
map_list
;
MapListRecord
(
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
map_list
)
:
map_list
(
std
::
move
(
map_list
))
MapListRecord
(
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
map_list
_
)
:
map_list
(
std
::
move
(
map_list
_
))
{}
};
...
...
test-suite/generated-src/cpp/map_record.hpp
View file @
180b4ba7
...
...
@@ -14,10 +14,10 @@ struct MapRecord final {
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
;
std
::
unordered_map
<
int32_t
,
int32_t
>
imap
;
MapRecord
(
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
,
std
::
unordered_map
<
int32_t
,
int32_t
>
imap
)
:
map
(
std
::
move
(
map
))
,
imap
(
std
::
move
(
imap
))
MapRecord
(
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
_
,
std
::
unordered_map
<
int32_t
,
int32_t
>
imap
_
)
:
map
(
std
::
move
(
map
_
))
,
imap
(
std
::
move
(
imap
_
))
{}
};
...
...
test-suite/generated-src/cpp/nested_collection.hpp
View file @
180b4ba7
...
...
@@ -13,8 +13,8 @@ namespace testsuite {
struct
NestedCollection
final
{
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
set_list
;
NestedCollection
(
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
set_list
)
:
set_list
(
std
::
move
(
set_list
))
NestedCollection
(
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
set_list
_
)
:
set_list
(
std
::
move
(
set_list
_
))
{}
};
...
...
test-suite/generated-src/cpp/primitive_list.hpp
View file @
180b4ba7
...
...
@@ -12,8 +12,8 @@ namespace testsuite {
struct
PrimitiveList
final
{
std
::
vector
<
int64_t
>
list
;
PrimitiveList
(
std
::
vector
<
int64_t
>
list
)
:
list
(
std
::
move
(
list
))
PrimitiveList
(
std
::
vector
<
int64_t
>
list
_
)
:
list
(
std
::
move
(
list
_
))
{}
};
...
...
test-suite/generated-src/cpp/record_with_derivings.hpp
View file @
180b4ba7
...
...
@@ -22,10 +22,10 @@ struct RecordWithDerivings final {
friend
bool
operator
<=
(
const
RecordWithDerivings
&
lhs
,
const
RecordWithDerivings
&
rhs
);
friend
bool
operator
>=
(
const
RecordWithDerivings
&
lhs
,
const
RecordWithDerivings
&
rhs
);
RecordWithDerivings
(
int32_t
key1
,
std
::
string
key2
)
:
key1
(
std
::
move
(
key1
))
,
key2
(
std
::
move
(
key2
))
RecordWithDerivings
(
int32_t
key1
_
,
std
::
string
key2
_
)
:
key1
(
std
::
move
(
key1
_
))
,
key2
(
std
::
move
(
key2
_
))
{}
};
...
...
test-suite/generated-src/cpp/record_with_duration_and_derivings.hpp
View file @
180b4ba7
...
...
@@ -20,8 +20,8 @@ struct RecordWithDurationAndDerivings final {
friend
bool
operator
<=
(
const
RecordWithDurationAndDerivings
&
lhs
,
const
RecordWithDurationAndDerivings
&
rhs
);
friend
bool
operator
>=
(
const
RecordWithDurationAndDerivings
&
lhs
,
const
RecordWithDurationAndDerivings
&
rhs
);
RecordWithDurationAndDerivings
(
std
::
chrono
::
duration
<
double
,
std
::
nano
>
dt
)
:
dt
(
std
::
move
(
dt
))
RecordWithDurationAndDerivings
(
std
::
chrono
::
duration
<
double
,
std
::
nano
>
dt
_
)
:
dt
(
std
::
move
(
dt
_
))
{}
};
...
...
test-suite/generated-src/cpp/record_with_nested_derivings.hpp
View file @
180b4ba7
...
...
@@ -22,10 +22,10 @@ struct RecordWithNestedDerivings final {
friend
bool
operator
<=
(
const
RecordWithNestedDerivings
&
lhs
,
const
RecordWithNestedDerivings
&
rhs
);
friend
bool
operator
>=
(
const
RecordWithNestedDerivings
&
lhs
,
const
RecordWithNestedDerivings
&
rhs
);
RecordWithNestedDerivings
(
int32_t
key
,
RecordWithDerivings
rec
)
:
key
(
std
::
move
(
key
))
,
rec
(
std
::
move
(
rec
))
RecordWithNestedDerivings
(
int32_t
key
_
,
RecordWithDerivings
rec
_
)
:
key
(
std
::
move
(
key
_
))
,
rec
(
std
::
move
(
rec
_
))
{}
};
...
...
test-suite/generated-src/cpp/set_record.hpp
View file @
180b4ba7
...
...
@@ -14,10 +14,10 @@ struct SetRecord final {
std
::
unordered_set
<
std
::
string
>
set
;
std
::
unordered_set
<
int32_t
>
iset
;
SetRecord
(
std
::
unordered_set
<
std
::
string
>
set
,
std
::
unordered_set
<
int32_t
>
iset
)
:
set
(
std
::
move
(
set
))
,
iset
(
std
::
move
(
iset
))
SetRecord
(
std
::
unordered_set
<
std
::
string
>
set
_
,
std
::
unordered_set
<
int32_t
>
iset
_
)
:
set
(
std
::
move
(
set
_
))
,
iset
(
std
::
move
(
iset
_
))
{}
};
...
...
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