Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
1065652b
Commit
1065652b
authored
Apr 03, 2019
by
Ankit Singh
Committed by
Adam Cozzette
Apr 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes unused code and lint warnings (#5773)
parent
8e5b2f1b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
16 deletions
+1
-16
cpp_message_field.cc
src/google/protobuf/compiler/cpp/cpp_message_field.cc
+1
-16
No files found.
src/google/protobuf/compiler/cpp/cpp_message_field.cc
View file @
1065652b
...
...
@@ -45,22 +45,7 @@ namespace cpp {
namespace
{
// When we are generating code for implicit weak fields, we need to insert some
// additional casts. These functions return the casted expression if
// implicit_weak_field is true but otherwise return the original expression.
// Ordinarily a static_cast is enough to cast google::protobuf::MessageLite* to a class
// deriving from it, but we need a reinterpret_cast in cases where the generated
// message is forward-declared but its full definition is not visible.
string
StaticCast
(
const
std
::
string
&
type
,
const
std
::
string
&
expression
,
bool
implicit_weak_field
)
{
if
(
implicit_weak_field
)
{
return
"static_cast< "
+
type
+
" >("
+
expression
+
")"
;
}
else
{
return
expression
;
}
}
string
ReinterpretCast
(
const
std
::
string
&
type
,
const
std
::
string
&
expression
,
string
ReinterpretCast
(
const
string
&
type
,
const
string
&
expression
,
bool
implicit_weak_field
)
{
if
(
implicit_weak_field
)
{
return
"reinterpret_cast< "
+
type
+
" >("
+
expression
+
")"
;
...
...
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