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
9c1c31ff
Commit
9c1c31ff
authored
Nov 30, 2012
by
xiaofeng@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile issues under GCC 3.4.6
parent
d2d50f9a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
11 deletions
+26
-11
repeated_field_reflection_unittest.cc
src/google/protobuf/repeated_field_reflection_unittest.cc
+2
-2
common.h
src/google/protobuf/stubs/common.h
+0
-6
text_format.cc
src/google/protobuf/text_format.cc
+3
-3
text_format.h
src/google/protobuf/text_format.h
+21
-0
No files found.
src/google/protobuf/repeated_field_reflection_unittest.cc
View file @
9c1c31ff
...
@@ -120,7 +120,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) {
...
@@ -120,7 +120,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) {
EXPECT_EQ
(
rf_double
.
Get
(
i
),
Func
(
i
,
2
));
EXPECT_EQ
(
rf_double
.
Get
(
i
),
Func
(
i
,
2
));
EXPECT_EQ
(
rpf_string
.
Get
(
i
),
StrFunc
(
i
,
5
));
EXPECT_EQ
(
rpf_string
.
Get
(
i
),
StrFunc
(
i
,
5
));
EXPECT_EQ
(
rpf_foreign_message
.
Get
(
i
).
c
(),
Func
(
i
,
6
));
EXPECT_EQ
(
rpf_foreign_message
.
Get
(
i
).
c
(),
Func
(
i
,
6
));
EXPECT_EQ
(
down_cast
<
const
ForeignMessage
&>
(
rpf_message
.
Get
(
i
)).
c
(),
EXPECT_EQ
(
down_cast
<
const
ForeignMessage
*>
(
&
rpf_message
.
Get
(
i
))
->
c
(),
Func
(
i
,
6
));
Func
(
i
,
6
));
// Check gets through mutable objects.
// Check gets through mutable objects.
...
@@ -128,7 +128,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) {
...
@@ -128,7 +128,7 @@ TEST(RepeatedFieldReflectionTest, RegularFields) {
EXPECT_EQ
(
mrf_double
->
Get
(
i
),
Func
(
i
,
2
));
EXPECT_EQ
(
mrf_double
->
Get
(
i
),
Func
(
i
,
2
));
EXPECT_EQ
(
mrpf_string
->
Get
(
i
),
StrFunc
(
i
,
5
));
EXPECT_EQ
(
mrpf_string
->
Get
(
i
),
StrFunc
(
i
,
5
));
EXPECT_EQ
(
mrpf_foreign_message
->
Get
(
i
).
c
(),
Func
(
i
,
6
));
EXPECT_EQ
(
mrpf_foreign_message
->
Get
(
i
).
c
(),
Func
(
i
,
6
));
EXPECT_EQ
(
down_cast
<
const
ForeignMessage
&>
(
mrpf_message
->
Get
(
i
)).
c
(),
EXPECT_EQ
(
down_cast
<
const
ForeignMessage
*>
(
&
mrpf_message
->
Get
(
i
))
->
c
(),
Func
(
i
,
6
));
Func
(
i
,
6
));
// Check sets through mutable objects.
// Check sets through mutable objects.
...
...
src/google/protobuf/stubs/common.h
View file @
9c1c31ff
...
@@ -341,12 +341,6 @@ inline To down_cast(From* f) { // so we only accept pointers
...
@@ -341,12 +341,6 @@ inline To down_cast(From* f) { // so we only accept pointers
return
static_cast
<
To
>
(
f
);
return
static_cast
<
To
>
(
f
);
}
}
// Simplified down_cast for reference type.
template
<
typename
To
,
typename
From
>
inline
To
down_cast
(
From
&
f
)
{
return
static_cast
<
To
>
(
f
);
}
}
// namespace internal
}
// namespace internal
// We made these internal so that they would show up as such in the docs,
// We made these internal so that they would show up as such in the docs,
...
...
src/google/protobuf/text_format.cc
View file @
9c1c31ff
...
@@ -434,8 +434,8 @@ class TextFormat::Parser::ParserImpl {
...
@@ -434,8 +434,8 @@ class TextFormat::Parser::ParserImpl {
// If a parse info tree exists, add the location for the parsed
// If a parse info tree exists, add the location for the parsed
// field.
// field.
if
(
parse_info_tree_
!=
NULL
)
{
if
(
parse_info_tree_
!=
NULL
)
{
parse_info_tree_
->
RecordLocation
(
field
,
RecordLocation
(
parse_info_tree_
,
field
,
ParseLocation
(
start_line
,
start_column
));
ParseLocation
(
start_line
,
start_column
));
}
}
return
true
;
return
true
;
...
@@ -483,7 +483,7 @@ class TextFormat::Parser::ParserImpl {
...
@@ -483,7 +483,7 @@ class TextFormat::Parser::ParserImpl {
// for the nested message.
// for the nested message.
ParseInfoTree
*
parent
=
parse_info_tree_
;
ParseInfoTree
*
parent
=
parse_info_tree_
;
if
(
parent
!=
NULL
)
{
if
(
parent
!=
NULL
)
{
parse_info_tree_
=
parent
->
CreateNested
(
field
);
parse_info_tree_
=
CreateNested
(
parent
,
field
);
}
}
string
delimeter
;
string
delimeter
;
...
...
src/google/protobuf/text_format.h
View file @
9c1c31ff
...
@@ -339,9 +339,30 @@ class LIBPROTOBUF_EXPORT TextFormat {
...
@@ -339,9 +339,30 @@ class LIBPROTOBUF_EXPORT TextFormat {
};
};
private
:
private
:
// Hack: ParseInfoTree declares TextFormat as a friend which should extend
// the friendship to TextFormat::Parser::ParserImpl, but unfortunately some
// old compilers (e.g. GCC 3.4.6) don't implement this correctly. We provide
// helpers for ParserImpl to call methods of ParseInfoTree.
static
inline
void
RecordLocation
(
ParseInfoTree
*
info_tree
,
const
FieldDescriptor
*
field
,
ParseLocation
location
);
static
inline
ParseInfoTree
*
CreateNested
(
ParseInfoTree
*
info_tree
,
const
FieldDescriptor
*
field
);
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
TextFormat
);
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
TextFormat
);
};
};
inline
void
TextFormat
::
RecordLocation
(
ParseInfoTree
*
info_tree
,
const
FieldDescriptor
*
field
,
ParseLocation
location
)
{
info_tree
->
RecordLocation
(
field
,
location
);
}
inline
TextFormat
::
ParseInfoTree
*
TextFormat
::
CreateNested
(
ParseInfoTree
*
info_tree
,
const
FieldDescriptor
*
field
)
{
return
info_tree
->
CreateNested
(
field
);
}
}
// namespace protobuf
}
// namespace protobuf
}
// namespace google
}
// namespace google
...
...
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