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
783f9e6e
Commit
783f9e6e
authored
Jun 10, 2015
by
j4cbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #102 from mknejp/f32-cpp-const-suffix
Add missing float suffix to cpp constants
parents
1330584c
6d6ca3d9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
src/source/CppGenerator.scala
src/source/CppGenerator.scala
+1
-0
test-suite/generated-src/cpp/constants.cpp
test-suite/generated-src/cpp/constants.cpp
+1
-1
test-suite/generated-src/cpp/constants_interface.cpp
test-suite/generated-src/cpp/constants_interface.cpp
+1
-1
No files found.
src/source/CppGenerator.scala
View file @
783f9e6e
...
...
@@ -95,6 +95,7 @@ class CppGenerator(spec: Spec) extends Generator(spec) {
def
generateCppConstants
(
w
:
IndentWriter
,
consts
:
Seq
[
Const
],
selfName
:
String
)
=
{
def
writeCppConst
(
w
:
IndentWriter
,
ty
:
TypeRef
,
v
:
Any
)
:
Unit
=
v
match
{
case
l
:
Long
=>
w
.
w
(
l
.
toString
)
case
d
:
Double
if
marshal.fieldType
(
ty
)
=
=
"float"
=>
w
.
w
(
d
.
toString
+
"f"
)
case
d
:
Double
=>
w
.
w
(
d
.
toString
)
case
b
:
Boolean
=>
w
.
w
(
if
(
b
)
"true"
else
"false"
)
case
s
:
String
=>
w
.
w
(
s
)
...
...
test-suite/generated-src/cpp/constants.cpp
View file @
783f9e6e
...
...
@@ -13,7 +13,7 @@ int32_t const Constants::I32_CONSTANT = 3;
int64_t
const
Constants
::
I64_CONSTANT
=
4
;
float
const
Constants
::
F32_CONSTANT
=
5.0
;
float
const
Constants
::
F32_CONSTANT
=
5.0
f
;
double
const
Constants
::
F64_CONSTANT
=
5.0
;
...
...
test-suite/generated-src/cpp/constants_interface.cpp
View file @
783f9e6e
...
...
@@ -13,6 +13,6 @@ int32_t const ConstantsInterface::I32_CONSTANT = 3;
int64_t
const
ConstantsInterface
::
I64_CONSTANT
=
4
;
float
const
ConstantsInterface
::
F32_CONSTANT
=
5.0
;
float
const
ConstantsInterface
::
F32_CONSTANT
=
5.0
f
;
double
const
ConstantsInterface
::
F64_CONSTANT
=
5.0
;
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