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
eb26a1ef
Commit
eb26a1ef
authored
Apr 16, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit Michael Poole's patch for explicitly constructing all class fields in
generated code.
parent
e59427a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
4 deletions
+18
-4
CHANGES.txt
CHANGES.txt
+2
-0
CONTRIBUTORS.txt
CONTRIBUTORS.txt
+3
-0
cpp_enum_field.cc
src/google/protobuf/compiler/cpp/cpp_enum_field.cc
+5
-1
cpp_message.cc
src/google/protobuf/compiler/cpp/cpp_message.cc
+1
-0
cpp_message_field.cc
src/google/protobuf/compiler/cpp/cpp_message_field.cc
+1
-1
cpp_primitive_field.cc
src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
+5
-1
cpp_string_field.cc
src/google/protobuf/compiler/cpp/cpp_string_field.cc
+1
-1
descriptor.pb.cc
src/google/protobuf/descriptor.pb.cc
+0
-0
No files found.
CHANGES.txt
View file @
eb26a1ef
...
...
@@ -22,6 +22,8 @@
* GzipInputStream and GzipOutputStream support reading/writing gzip- or
zlib-compressed streams if zlib is available.
(google/protobuf/io/gzip_stream.h)
* Generated constructors explicitly initialize all fields (to avoid warnings
with certain compiler settings).
Java
* Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
...
...
CONTRIBUTORS.txt
View file @
eb26a1ef
...
...
@@ -59,3 +59,6 @@ Patch contributors:
* MS Visual Studio error format option.
Brian Olson <brianolson@google.com>
* gzip/zlib I/O support.
Michael Poole <mdpoole@troilus.org>
* Fixed warnings about generated constructors not explicitly initializing
all fields (only present with certain compiler settings).
src/google/protobuf/compiler/cpp/cpp_enum_field.cc
View file @
eb26a1ef
...
...
@@ -218,7 +218,11 @@ GenerateSwappingCode(io::Printer* printer) const {
void
RepeatedEnumFieldGenerator
::
GenerateInitializer
(
io
::
Printer
*
printer
)
const
{
// Not needed for repeated fields.
printer
->
Print
(
variables_
,
",
\n
$name$_()"
);
if
(
descriptor_
->
options
().
packed
()
&&
descriptor_
->
file
()
->
options
().
optimize_for
()
==
FileOptions
::
SPEED
)
{
printer
->
Print
(
variables_
,
",
\n
_$name$_cached_byte_size_()"
);
}
}
void
RepeatedEnumFieldGenerator
::
...
...
src/google/protobuf/compiler/cpp/cpp_message.cc
View file @
eb26a1ef
...
...
@@ -753,6 +753,7 @@ GenerateInitializerList(io::Printer* printer) {
}
printer
->
Print
(
"_unknown_fields_(),
\n
"
"_cached_size_(0)"
);
// Write the initializers for each field.
...
...
src/google/protobuf/compiler/cpp/cpp_message_field.cc
View file @
eb26a1ef
...
...
@@ -213,7 +213,7 @@ GenerateSwappingCode(io::Printer* printer) const {
void
RepeatedMessageFieldGenerator
::
GenerateInitializer
(
io
::
Printer
*
printer
)
const
{
// Not needed for repeated fields.
printer
->
Print
(
variables_
,
",
\n
$name$_()"
);
}
void
RepeatedMessageFieldGenerator
::
...
...
src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
View file @
eb26a1ef
...
...
@@ -283,7 +283,11 @@ GenerateSwappingCode(io::Printer* printer) const {
void
RepeatedPrimitiveFieldGenerator
::
GenerateInitializer
(
io
::
Printer
*
printer
)
const
{
// Not needed for repeated fields.
printer
->
Print
(
variables_
,
",
\n
$name$_()"
);
if
(
descriptor_
->
options
().
packed
()
&&
descriptor_
->
file
()
->
options
().
optimize_for
()
==
FileOptions
::
SPEED
)
{
printer
->
Print
(
variables_
,
",
\n
_$name$_cached_byte_size_()"
);
}
}
void
RepeatedPrimitiveFieldGenerator
::
...
...
src/google/protobuf/compiler/cpp/cpp_string_field.cc
View file @
eb26a1ef
...
...
@@ -361,7 +361,7 @@ GenerateSwappingCode(io::Printer* printer) const {
void
RepeatedStringFieldGenerator
::
GenerateInitializer
(
io
::
Printer
*
printer
)
const
{
// Not needed for repeated fields.
printer
->
Print
(
variables_
,
",
\n
$name$_()"
);
}
void
RepeatedStringFieldGenerator
::
...
...
src/google/protobuf/descriptor.pb.cc
View file @
eb26a1ef
This diff is collapsed.
Click to expand it.
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