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
2107a7d5
Commit
2107a7d5
authored
Oct 29, 2015
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed assert in flatc converting to text.
Change-Id: Idac375b22aa9beaba162084cc3396f5536a4e721 Tested: on Linux.
parent
40b03519
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
flatbuffers.h
include/flatbuffers/flatbuffers.h
+5
-0
flatc.cpp
src/flatc.cpp
+3
-3
No files found.
include/flatbuffers/flatbuffers.h
View file @
2107a7d5
...
@@ -582,6 +582,11 @@ class FlatBufferBuilder FLATBUFFERS_FINAL_CLASS {
...
@@ -582,6 +582,11 @@ class FlatBufferBuilder FLATBUFFERS_FINAL_CLASS {
buf_
.
fill
(
PaddingBytes
(
buf_
.
size
(),
elem_size
));
buf_
.
fill
(
PaddingBytes
(
buf_
.
size
(),
elem_size
));
}
}
void
PushFlatBuffer
(
const
uint8_t
*
bytes
,
size_t
size
)
{
PushBytes
(
bytes
,
size
);
finished
=
true
;
}
void
PushBytes
(
const
uint8_t
*
bytes
,
size_t
size
)
{
void
PushBytes
(
const
uint8_t
*
bytes
,
size_t
size
)
{
buf_
.
push
(
bytes
,
size
);
buf_
.
push
(
bytes
,
size
);
}
}
...
...
src/flatc.cpp
View file @
2107a7d5
...
@@ -98,7 +98,7 @@ static void Error(const std::string &err, bool usage, bool show_exe_name) {
...
@@ -98,7 +98,7 @@ static void Error(const std::string &err, bool usage, bool show_exe_name) {
" also implies --no-prefix.
\n
"
" also implies --no-prefix.
\n
"
" --gen-includes (deprecated), this is the default behavior.
\n
"
" --gen-includes (deprecated), this is the default behavior.
\n
"
" If the original behavior is required (no include
\n
"
" If the original behavior is required (no include
\n
"
" statements) use --no-includes.
\n
"
" statements) use --no-includes.
\n
"
" --no-includes Don
\'
t generate include statements for included
\n
"
" --no-includes Don
\'
t generate include statements for included
\n
"
" schemas the generated file depends on (C++).
\n
"
" schemas the generated file depends on (C++).
\n
"
" --gen-mutable Generate accessors that can mutate buffers in-place.
\n
"
" --gen-mutable Generate accessors that can mutate buffers in-place.
\n
"
...
@@ -201,13 +201,13 @@ int main(int argc, const char *argv[]) {
...
@@ -201,13 +201,13 @@ int main(int argc, const char *argv[]) {
++
file_it
)
{
++
file_it
)
{
std
::
string
contents
;
std
::
string
contents
;
if
(
!
flatbuffers
::
LoadFile
(
file_it
->
c_str
(),
true
,
&
contents
))
if
(
!
flatbuffers
::
LoadFile
(
file_it
->
c_str
(),
true
,
&
contents
))
Error
(
"unable to load file"
+
*
file_it
);
Error
(
"unable to load file
:
"
+
*
file_it
);
bool
is_binary
=
static_cast
<
size_t
>
(
file_it
-
filenames
.
begin
())
>=
bool
is_binary
=
static_cast
<
size_t
>
(
file_it
-
filenames
.
begin
())
>=
binary_files_from
;
binary_files_from
;
if
(
is_binary
)
{
if
(
is_binary
)
{
parser
.
builder_
.
Clear
();
parser
.
builder_
.
Clear
();
parser
.
builder_
.
Push
Bytes
(
parser
.
builder_
.
Push
FlatBuffer
(
reinterpret_cast
<
const
uint8_t
*>
(
contents
.
c_str
()),
reinterpret_cast
<
const
uint8_t
*>
(
contents
.
c_str
()),
contents
.
length
());
contents
.
length
());
if
(
!
raw_binary
)
{
if
(
!
raw_binary
)
{
...
...
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