Merge pull request #4517 from rcane/feature/vc2017_build_fix

Fixed a Visual Studio 2017 build error. (#4488)
pull/4522/head
Adam Cozzette 7 years ago committed by GitHub
commit 9497a657d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/google/protobuf/compiler/cpp/cpp_field.cc
  2. 2
      src/google/protobuf/compiler/cpp/cpp_field.h
  3. 6
      src/google/protobuf/compiler/java/java_field.cc
  4. 2
      src/google/protobuf/compiler/java/java_field.h
  5. 6
      src/google/protobuf/compiler/java/java_file.cc
  6. 4
      src/google/protobuf/compiler/java/java_file.h
  7. 6
      src/google/protobuf/compiler/objectivec/objectivec_field.cc
  8. 4
      src/google/protobuf/compiler/objectivec/objectivec_field.h

@ -117,8 +117,7 @@ FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor,
SCCAnalyzer* scc_analyzer) SCCAnalyzer* scc_analyzer)
: descriptor_(descriptor), : descriptor_(descriptor),
options_(options), options_(options),
field_generators_( field_generators_(descriptor->field_count()) {
new std::unique_ptr<FieldGenerator>[descriptor->field_count()]) {
// Construct all the FieldGenerators. // Construct all the FieldGenerators.
for (int i = 0; i < descriptor->field_count(); i++) { for (int i = 0; i < descriptor->field_count(); i++) {
field_generators_[i].reset( field_generators_[i].reset(

@ -203,7 +203,7 @@ class FieldGeneratorMap {
private: private:
const Descriptor* descriptor_; const Descriptor* descriptor_;
const Options& options_; const Options& options_;
std::unique_ptr<std::unique_ptr<FieldGenerator> []> field_generators_; std::vector<std::unique_ptr<FieldGenerator>> field_generators_;
static FieldGenerator* MakeGenerator(const FieldDescriptor* field, static FieldGenerator* MakeGenerator(const FieldDescriptor* field,
const Options& options, const Options& options,

@ -211,8 +211,7 @@ template <>
FieldGeneratorMap<ImmutableFieldGenerator>::FieldGeneratorMap( FieldGeneratorMap<ImmutableFieldGenerator>::FieldGeneratorMap(
const Descriptor* descriptor, Context* context) const Descriptor* descriptor, Context* context)
: descriptor_(descriptor), : descriptor_(descriptor),
field_generators_(new std::unique_ptr< field_generators_(descriptor->field_count()) {
ImmutableFieldGenerator>[descriptor->field_count()]) {
// Construct all the FieldGenerators and assign them bit indices for their // Construct all the FieldGenerators and assign them bit indices for their
// bit fields. // bit fields.
@ -234,8 +233,7 @@ template <>
FieldGeneratorMap<ImmutableFieldLiteGenerator>::FieldGeneratorMap( FieldGeneratorMap<ImmutableFieldLiteGenerator>::FieldGeneratorMap(
const Descriptor* descriptor, Context* context) const Descriptor* descriptor, Context* context)
: descriptor_(descriptor), : descriptor_(descriptor),
field_generators_(new std::unique_ptr< field_generators_(descriptor->field_count()) {
ImmutableFieldLiteGenerator>[descriptor->field_count()]) {
// Construct all the FieldGenerators and assign them bit indices for their // Construct all the FieldGenerators and assign them bit indices for their
// bit fields. // bit fields.
int messageBitIndex = 0; int messageBitIndex = 0;

@ -138,7 +138,7 @@ class FieldGeneratorMap {
const Descriptor* descriptor_; const Descriptor* descriptor_;
Context* context_; Context* context_;
ClassNameResolver* name_resolver_; ClassNameResolver* name_resolver_;
std::unique_ptr<std::unique_ptr<FieldGeneratorType> []> field_generators_; std::vector<std::unique_ptr<FieldGeneratorType>> field_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap);
}; };

@ -186,10 +186,8 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options,
bool immutable_api) bool immutable_api)
: file_(file), : file_(file),
java_package_(FileJavaPackage(file, immutable_api)), java_package_(FileJavaPackage(file, immutable_api)),
message_generators_( message_generators_(file->message_type_count()),
new std::unique_ptr<MessageGenerator>[file->message_type_count()]), extension_generators_(file->extension_count()),
extension_generators_(
new std::unique_ptr<ExtensionGenerator>[file->extension_count()]),
context_(new Context(file, options)), context_(new Context(file, options)),
name_resolver_(context_->GetNameResolver()), name_resolver_(context_->GetNameResolver()),
options_(options), options_(options),

@ -98,8 +98,8 @@ class FileGenerator {
string java_package_; string java_package_;
string classname_; string classname_;
std::unique_ptr<std::unique_ptr<MessageGenerator> []> message_generators_; std::vector<std::unique_ptr<MessageGenerator>> message_generators_;
std::unique_ptr<std::unique_ptr<ExtensionGenerator> []> extension_generators_; std::vector<std::unique_ptr<ExtensionGenerator>> extension_generators_;
std::unique_ptr<GeneratorFactory> generator_factory_; std::unique_ptr<GeneratorFactory> generator_factory_;
std::unique_ptr<Context> context_; std::unique_ptr<Context> context_;
ClassNameResolver* name_resolver_; ClassNameResolver* name_resolver_;

@ -410,10 +410,8 @@ bool RepeatedFieldGenerator::RuntimeUsesHasBit(void) const {
FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor, FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor,
const Options& options) const Options& options)
: descriptor_(descriptor), : descriptor_(descriptor),
field_generators_( field_generators_(descriptor->field_count()),
new std::unique_ptr<FieldGenerator>[descriptor->field_count()]), extension_generators_(descriptor->extension_count()) {
extension_generators_(
new std::unique_ptr<FieldGenerator>[descriptor->extension_count()]) {
// Construct all the FieldGenerators. // Construct all the FieldGenerators.
for (int i = 0; i < descriptor->field_count(); i++) { for (int i = 0; i < descriptor->field_count(); i++) {
field_generators_[i].reset( field_generators_[i].reset(

@ -182,8 +182,8 @@ class FieldGeneratorMap {
private: private:
const Descriptor* descriptor_; const Descriptor* descriptor_;
std::unique_ptr<std::unique_ptr<FieldGenerator>[]> field_generators_; std::vector<std::unique_ptr<FieldGenerator>> field_generators_;
std::unique_ptr<std::unique_ptr<FieldGenerator>[]> extension_generators_; std::vector<std::unique_ptr<FieldGenerator>> extension_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap);
}; };

Loading…
Cancel
Save