Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
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
flatbuffers
Commits
85b131a7
Commit
85b131a7
authored
Dec 04, 2017
by
Bastien Brunnenstein
Committed by
Wouter van Oortmerssen
Dec 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the non standard M_PI with a constant (#4528)
parent
0e8a2185
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
idl_parser.cpp
src/idl_parser.cpp
+4
-8
No files found.
src/idl_parser.cpp
View file @
85b131a7
...
...
@@ -18,12 +18,6 @@
#include <list>
#include <iostream>
#ifdef _WIN32
#if !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES // For M_PI.
#endif // !defined(_USE_MATH_DEFINES)
#endif // _WIN32
#include <math.h>
#include "flatbuffers/idl.h"
...
...
@@ -31,6 +25,8 @@
namespace
flatbuffers
{
const
double
kPi
=
3.14159265358979323846
;
const
char
*
const
kTypeNames
[]
=
{
#define FLATBUFFERS_TD(ENUM, IDLTYPE, \
CTYPE, JTYPE, GTYPE, NTYPE, PTYPE) \
...
...
@@ -1272,8 +1268,8 @@ CheckedError Parser::ParseSingleValue(Value &e) {
auto x = strtod(e.constant.c_str(), nullptr); \
e.constant = NumToString(op); \
}
FLATBUFFERS_FN_DOUBLE
(
"deg"
,
x
/
M_PI
*
180
);
FLATBUFFERS_FN_DOUBLE
(
"rad"
,
x
*
M_PI
/
180
);
FLATBUFFERS_FN_DOUBLE
(
"deg"
,
x
/
kPi
*
180
);
FLATBUFFERS_FN_DOUBLE
(
"rad"
,
x
*
kPi
/
180
);
FLATBUFFERS_FN_DOUBLE
(
"sin"
,
sin
(
x
));
FLATBUFFERS_FN_DOUBLE
(
"cos"
,
cos
(
x
));
FLATBUFFERS_FN_DOUBLE
(
"tan"
,
tan
(
x
));
...
...
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