From 7f1ff650dbdd7e589876477f2a6a92ea3ca50c35 Mon Sep 17 00:00:00 2001 From: "scottmg@chromium.org" Date: Fri, 14 Feb 2014 00:47:37 +0000 Subject: [PATCH] Replace kEmptyString with OnceInit initialized string* This removes the global constructor call for std::string kEmptyString. This is roughly an application of b/7549760 from the internal version of protobuf. Upstream patch here https://codereview.appspot.com/63480043/. R=fischman@chromium.org TBR=darin@chromium.org BUG=341941,94925 Review URL: https://codereview.chromium.org/164743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251212 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/protobuf/README.chromium | 1 + .../protobuf/compiler/cpp/cpp_string_field.cc | 2 +- .../src/google/protobuf/compiler/plugin.pb.cc | 30 +- .../src/google/protobuf/compiler/plugin.pb.h | 90 ++--- .../protobuf/src/google/protobuf/descriptor.cc | 8 +- .../protobuf/src/google/protobuf/descriptor.pb.cc | 138 +++---- .../protobuf/src/google/protobuf/descriptor.pb.h | 414 ++++++++++----------- .../protobuf/generated_message_reflection.cc | 10 +- .../src/google/protobuf/generated_message_util.cc | 7 +- .../src/google/protobuf/generated_message_util.h | 14 +- .../protobuf/src/google/protobuf/repeated_field.h | 2 +- 11 files changed, 365 insertions(+), 351 deletions(-) diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium index f9f90e2ba562..fcd7094811d7 100644 --- a/third_party/protobuf/README.chromium +++ b/third_party/protobuf/README.chromium @@ -28,6 +28,7 @@ details, and r179806 for the patch. Revision 504 was cherry-picked from upstream. Revision 512 was cherry-picked from upstream. +Revision 517 was cherry-picked from upstream. Notes about Java: We have not forked the Java version of protobuf-lite, so the Java version does diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc index 9c0911ac9690..0b58b981ec5b 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc @@ -53,7 +53,7 @@ void SetStringVariables(const FieldDescriptor* descriptor, (*variables)["default_length"] = SimpleItoa(descriptor->default_value_string().length()); (*variables)["default_variable"] = descriptor->default_value_string().empty() - ? "&::google::protobuf::internal::kEmptyString" + ? "&::google::protobuf::internal::GetEmptyString()" : "_default_" + FieldName(descriptor) + "_"; (*variables)["pointer_type"] = descriptor->type() == FieldDescriptor::TYPE_BYTES ? "void" : "char"; diff --git a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc index 88559b8fcafe..8dcc60426868 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc @@ -184,7 +184,7 @@ CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from) void CodeGeneratorRequest::SharedCtor() { _cached_size_ = 0; - parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -193,7 +193,7 @@ CodeGeneratorRequest::~CodeGeneratorRequest() { } void CodeGeneratorRequest::SharedDtor() { - if (parameter_ != &::google::protobuf::internal::kEmptyString) { + if (parameter_ != &::google::protobuf::internal::GetEmptyString()) { delete parameter_; } if (this != default_instance_) { @@ -224,7 +224,7 @@ CodeGeneratorRequest* CodeGeneratorRequest::New() const { void CodeGeneratorRequest::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (has_parameter()) { - if (parameter_ != &::google::protobuf::internal::kEmptyString) { + if (parameter_ != &::google::protobuf::internal::GetEmptyString()) { parameter_->clear(); } } @@ -501,9 +501,9 @@ CodeGeneratorResponse_File::CodeGeneratorResponse_File(const CodeGeneratorRespon void CodeGeneratorResponse_File::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -512,13 +512,13 @@ CodeGeneratorResponse_File::~CodeGeneratorResponse_File() { } void CodeGeneratorResponse_File::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } - if (insertion_point_ != &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) { delete insertion_point_; } - if (content_ != &::google::protobuf::internal::kEmptyString) { + if (content_ != &::google::protobuf::internal::GetEmptyString()) { delete content_; } if (this != default_instance_) { @@ -549,17 +549,17 @@ CodeGeneratorResponse_File* CodeGeneratorResponse_File::New() const { void CodeGeneratorResponse_File::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } if (has_insertion_point()) { - if (insertion_point_ != &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) { insertion_point_->clear(); } } if (has_content()) { - if (content_ != &::google::protobuf::internal::kEmptyString) { + if (content_ != &::google::protobuf::internal::GetEmptyString()) { content_->clear(); } } @@ -839,7 +839,7 @@ CodeGeneratorResponse::CodeGeneratorResponse(const CodeGeneratorResponse& from) void CodeGeneratorResponse::SharedCtor() { _cached_size_ = 0; - error_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + error_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -848,7 +848,7 @@ CodeGeneratorResponse::~CodeGeneratorResponse() { } void CodeGeneratorResponse::SharedDtor() { - if (error_ != &::google::protobuf::internal::kEmptyString) { + if (error_ != &::google::protobuf::internal::GetEmptyString()) { delete error_; } if (this != default_instance_) { @@ -879,7 +879,7 @@ CodeGeneratorResponse* CodeGeneratorResponse::New() const { void CodeGeneratorResponse::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_error()) { - if (error_ != &::google::protobuf::internal::kEmptyString) { + if (error_ != &::google::protobuf::internal::GetEmptyString()) { error_->clear(); } } diff --git a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h index 68cc21c7f8f0..6aa1661da0f9 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h +++ b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h @@ -438,7 +438,7 @@ inline void CodeGeneratorRequest::clear_has_parameter() { _has_bits_[0] &= ~0x00000002u; } inline void CodeGeneratorRequest::clear_parameter() { - if (parameter_ != &::google::protobuf::internal::kEmptyString) { + if (parameter_ != &::google::protobuf::internal::GetEmptyString()) { parameter_->clear(); } clear_has_parameter(); @@ -448,44 +448,44 @@ inline const ::std::string& CodeGeneratorRequest::parameter() const { } inline void CodeGeneratorRequest::set_parameter(const ::std::string& value) { set_has_parameter(); - if (parameter_ == &::google::protobuf::internal::kEmptyString) { + if (parameter_ == &::google::protobuf::internal::GetEmptyString()) { parameter_ = new ::std::string; } parameter_->assign(value); } inline void CodeGeneratorRequest::set_parameter(const char* value) { set_has_parameter(); - if (parameter_ == &::google::protobuf::internal::kEmptyString) { + if (parameter_ == &::google::protobuf::internal::GetEmptyString()) { parameter_ = new ::std::string; } parameter_->assign(value); } inline void CodeGeneratorRequest::set_parameter(const char* value, size_t size) { set_has_parameter(); - if (parameter_ == &::google::protobuf::internal::kEmptyString) { + if (parameter_ == &::google::protobuf::internal::GetEmptyString()) { parameter_ = new ::std::string; } parameter_->assign(reinterpret_cast(value), size); } inline ::std::string* CodeGeneratorRequest::mutable_parameter() { set_has_parameter(); - if (parameter_ == &::google::protobuf::internal::kEmptyString) { + if (parameter_ == &::google::protobuf::internal::GetEmptyString()) { parameter_ = new ::std::string; } return parameter_; } inline ::std::string* CodeGeneratorRequest::release_parameter() { clear_has_parameter(); - if (parameter_ == &::google::protobuf::internal::kEmptyString) { + if (parameter_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = parameter_; - parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void CodeGeneratorRequest::set_allocated_parameter(::std::string* parameter) { - if (parameter_ != &::google::protobuf::internal::kEmptyString) { + if (parameter_ != &::google::protobuf::internal::GetEmptyString()) { delete parameter_; } if (parameter) { @@ -493,7 +493,7 @@ inline void CodeGeneratorRequest::set_allocated_parameter(::std::string* paramet parameter_ = parameter; } else { clear_has_parameter(); - parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -537,7 +537,7 @@ inline void CodeGeneratorResponse_File::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void CodeGeneratorResponse_File::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -547,44 +547,44 @@ inline const ::std::string& CodeGeneratorResponse_File::name() const { } inline void CodeGeneratorResponse_File::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void CodeGeneratorResponse_File::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void CodeGeneratorResponse_File::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* CodeGeneratorResponse_File::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* CodeGeneratorResponse_File::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void CodeGeneratorResponse_File::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -592,7 +592,7 @@ inline void CodeGeneratorResponse_File::set_allocated_name(::std::string* name) name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -607,7 +607,7 @@ inline void CodeGeneratorResponse_File::clear_has_insertion_point() { _has_bits_[0] &= ~0x00000002u; } inline void CodeGeneratorResponse_File::clear_insertion_point() { - if (insertion_point_ != &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) { insertion_point_->clear(); } clear_has_insertion_point(); @@ -617,44 +617,44 @@ inline const ::std::string& CodeGeneratorResponse_File::insertion_point() const } inline void CodeGeneratorResponse_File::set_insertion_point(const ::std::string& value) { set_has_insertion_point(); - if (insertion_point_ == &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ == &::google::protobuf::internal::GetEmptyString()) { insertion_point_ = new ::std::string; } insertion_point_->assign(value); } inline void CodeGeneratorResponse_File::set_insertion_point(const char* value) { set_has_insertion_point(); - if (insertion_point_ == &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ == &::google::protobuf::internal::GetEmptyString()) { insertion_point_ = new ::std::string; } insertion_point_->assign(value); } inline void CodeGeneratorResponse_File::set_insertion_point(const char* value, size_t size) { set_has_insertion_point(); - if (insertion_point_ == &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ == &::google::protobuf::internal::GetEmptyString()) { insertion_point_ = new ::std::string; } insertion_point_->assign(reinterpret_cast(value), size); } inline ::std::string* CodeGeneratorResponse_File::mutable_insertion_point() { set_has_insertion_point(); - if (insertion_point_ == &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ == &::google::protobuf::internal::GetEmptyString()) { insertion_point_ = new ::std::string; } return insertion_point_; } inline ::std::string* CodeGeneratorResponse_File::release_insertion_point() { clear_has_insertion_point(); - if (insertion_point_ == &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = insertion_point_; - insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void CodeGeneratorResponse_File::set_allocated_insertion_point(::std::string* insertion_point) { - if (insertion_point_ != &::google::protobuf::internal::kEmptyString) { + if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) { delete insertion_point_; } if (insertion_point) { @@ -662,7 +662,7 @@ inline void CodeGeneratorResponse_File::set_allocated_insertion_point(::std::str insertion_point_ = insertion_point; } else { clear_has_insertion_point(); - insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -677,7 +677,7 @@ inline void CodeGeneratorResponse_File::clear_has_content() { _has_bits_[0] &= ~0x00000004u; } inline void CodeGeneratorResponse_File::clear_content() { - if (content_ != &::google::protobuf::internal::kEmptyString) { + if (content_ != &::google::protobuf::internal::GetEmptyString()) { content_->clear(); } clear_has_content(); @@ -687,44 +687,44 @@ inline const ::std::string& CodeGeneratorResponse_File::content() const { } inline void CodeGeneratorResponse_File::set_content(const ::std::string& value) { set_has_content(); - if (content_ == &::google::protobuf::internal::kEmptyString) { + if (content_ == &::google::protobuf::internal::GetEmptyString()) { content_ = new ::std::string; } content_->assign(value); } inline void CodeGeneratorResponse_File::set_content(const char* value) { set_has_content(); - if (content_ == &::google::protobuf::internal::kEmptyString) { + if (content_ == &::google::protobuf::internal::GetEmptyString()) { content_ = new ::std::string; } content_->assign(value); } inline void CodeGeneratorResponse_File::set_content(const char* value, size_t size) { set_has_content(); - if (content_ == &::google::protobuf::internal::kEmptyString) { + if (content_ == &::google::protobuf::internal::GetEmptyString()) { content_ = new ::std::string; } content_->assign(reinterpret_cast(value), size); } inline ::std::string* CodeGeneratorResponse_File::mutable_content() { set_has_content(); - if (content_ == &::google::protobuf::internal::kEmptyString) { + if (content_ == &::google::protobuf::internal::GetEmptyString()) { content_ = new ::std::string; } return content_; } inline ::std::string* CodeGeneratorResponse_File::release_content() { clear_has_content(); - if (content_ == &::google::protobuf::internal::kEmptyString) { + if (content_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = content_; - content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void CodeGeneratorResponse_File::set_allocated_content(::std::string* content) { - if (content_ != &::google::protobuf::internal::kEmptyString) { + if (content_ != &::google::protobuf::internal::GetEmptyString()) { delete content_; } if (content) { @@ -732,7 +732,7 @@ inline void CodeGeneratorResponse_File::set_allocated_content(::std::string* con content_ = content; } else { clear_has_content(); - content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -751,7 +751,7 @@ inline void CodeGeneratorResponse::clear_has_error() { _has_bits_[0] &= ~0x00000001u; } inline void CodeGeneratorResponse::clear_error() { - if (error_ != &::google::protobuf::internal::kEmptyString) { + if (error_ != &::google::protobuf::internal::GetEmptyString()) { error_->clear(); } clear_has_error(); @@ -761,44 +761,44 @@ inline const ::std::string& CodeGeneratorResponse::error() const { } inline void CodeGeneratorResponse::set_error(const ::std::string& value) { set_has_error(); - if (error_ == &::google::protobuf::internal::kEmptyString) { + if (error_ == &::google::protobuf::internal::GetEmptyString()) { error_ = new ::std::string; } error_->assign(value); } inline void CodeGeneratorResponse::set_error(const char* value) { set_has_error(); - if (error_ == &::google::protobuf::internal::kEmptyString) { + if (error_ == &::google::protobuf::internal::GetEmptyString()) { error_ = new ::std::string; } error_->assign(value); } inline void CodeGeneratorResponse::set_error(const char* value, size_t size) { set_has_error(); - if (error_ == &::google::protobuf::internal::kEmptyString) { + if (error_ == &::google::protobuf::internal::GetEmptyString()) { error_ = new ::std::string; } error_->assign(reinterpret_cast(value), size); } inline ::std::string* CodeGeneratorResponse::mutable_error() { set_has_error(); - if (error_ == &::google::protobuf::internal::kEmptyString) { + if (error_ == &::google::protobuf::internal::GetEmptyString()) { error_ = new ::std::string; } return error_; } inline ::std::string* CodeGeneratorResponse::release_error() { clear_has_error(); - if (error_ == &::google::protobuf::internal::kEmptyString) { + if (error_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = error_; - error_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + error_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void CodeGeneratorResponse::set_allocated_error(::std::string* error) { - if (error_ != &::google::protobuf::internal::kEmptyString) { + if (error_ != &::google::protobuf::internal::GetEmptyString()) { delete error_; } if (error) { @@ -806,7 +806,7 @@ inline void CodeGeneratorResponse::set_allocated_error(::std::string* error) { error_ = error; } else { clear_has_error(); - error_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + error_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } diff --git a/third_party/protobuf/src/google/protobuf/descriptor.cc b/third_party/protobuf/src/google/protobuf/descriptor.cc index bcbf1e079f63..c2bc81a2dd6f 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.cc +++ b/third_party/protobuf/src/google/protobuf/descriptor.cc @@ -139,8 +139,6 @@ const int FieldDescriptor::kLastReservedNumber; namespace { -const string kEmptyString; - string ToCamelCase(const string& input) { bool capitalize_next = false; string result; @@ -2757,7 +2755,7 @@ Symbol DescriptorBuilder::NewPlaceholder(const string& name, placeholder_name = tables_->AllocateString( placeholder_full_name->substr(dotpos + 1)); } else { - placeholder_package = &kEmptyString; + placeholder_package = &::google::protobuf::internal::GetEmptyString(); placeholder_name = placeholder_full_name; } @@ -2843,7 +2841,7 @@ const FileDescriptor* DescriptorBuilder::NewPlaceholderFile( memset(placeholder, 0, sizeof(*placeholder)); placeholder->name_ = tables_->AllocateString(name); - placeholder->package_ = &kEmptyString; + placeholder->package_ = &::google::protobuf::internal::GetEmptyString(); placeholder->pool_ = pool_; placeholder->options_ = &FileOptions::default_instance(); placeholder->tables_ = &FileDescriptorTables::kEmpty; @@ -3485,7 +3483,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, result->default_value_enum_ = NULL; break; case FieldDescriptor::CPPTYPE_STRING: - result->default_value_string_ = &kEmptyString; + result->default_value_string_ = &::google::protobuf::internal::GetEmptyString(); break; case FieldDescriptor::CPPTYPE_MESSAGE: break; diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc b/third_party/protobuf/src/google/protobuf/descriptor.pb.cc index a05414a34477..b8ace41bc59c 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.cc @@ -964,8 +964,8 @@ FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) void FileDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; source_code_info_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -976,10 +976,10 @@ FileDescriptorProto::~FileDescriptorProto() { } void FileDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } - if (package_ != &::google::protobuf::internal::kEmptyString) { + if (package_ != &::google::protobuf::internal::GetEmptyString()) { delete package_; } if (this != default_instance_) { @@ -1012,12 +1012,12 @@ FileDescriptorProto* FileDescriptorProto::New() const { void FileDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } if (has_package()) { - if (package_ != &::google::protobuf::internal::kEmptyString) { + if (package_ != &::google::protobuf::internal::GetEmptyString()) { package_->clear(); } } @@ -1904,7 +1904,7 @@ DescriptorProto::DescriptorProto(const DescriptorProto& from) void DescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -1914,7 +1914,7 @@ DescriptorProto::~DescriptorProto() { } void DescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (this != default_instance_) { @@ -1946,7 +1946,7 @@ DescriptorProto* DescriptorProto::New() const { void DescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } @@ -2466,13 +2466,13 @@ FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) void FieldDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); number_ = 0; label_ = 1; type_ = 1; - type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -2482,16 +2482,16 @@ FieldDescriptorProto::~FieldDescriptorProto() { } void FieldDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } - if (type_name_ != &::google::protobuf::internal::kEmptyString) { + if (type_name_ != &::google::protobuf::internal::GetEmptyString()) { delete type_name_; } - if (extendee_ != &::google::protobuf::internal::kEmptyString) { + if (extendee_ != &::google::protobuf::internal::GetEmptyString()) { delete extendee_; } - if (default_value_ != &::google::protobuf::internal::kEmptyString) { + if (default_value_ != &::google::protobuf::internal::GetEmptyString()) { delete default_value_; } if (this != default_instance_) { @@ -2523,7 +2523,7 @@ FieldDescriptorProto* FieldDescriptorProto::New() const { void FieldDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } @@ -2531,17 +2531,17 @@ void FieldDescriptorProto::Clear() { label_ = 1; type_ = 1; if (has_type_name()) { - if (type_name_ != &::google::protobuf::internal::kEmptyString) { + if (type_name_ != &::google::protobuf::internal::GetEmptyString()) { type_name_->clear(); } } if (has_extendee()) { - if (extendee_ != &::google::protobuf::internal::kEmptyString) { + if (extendee_ != &::google::protobuf::internal::GetEmptyString()) { extendee_->clear(); } } if (has_default_value()) { - if (default_value_ != &::google::protobuf::internal::kEmptyString) { + if (default_value_ != &::google::protobuf::internal::GetEmptyString()) { default_value_->clear(); } } @@ -3037,7 +3037,7 @@ EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) void EnumDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -3047,7 +3047,7 @@ EnumDescriptorProto::~EnumDescriptorProto() { } void EnumDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (this != default_instance_) { @@ -3079,7 +3079,7 @@ EnumDescriptorProto* EnumDescriptorProto::New() const { void EnumDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } @@ -3353,7 +3353,7 @@ EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProt void EnumValueDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); number_ = 0; options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -3364,7 +3364,7 @@ EnumValueDescriptorProto::~EnumValueDescriptorProto() { } void EnumValueDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (this != default_instance_) { @@ -3396,7 +3396,7 @@ EnumValueDescriptorProto* EnumValueDescriptorProto::New() const { void EnumValueDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } @@ -3666,7 +3666,7 @@ ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& fro void ServiceDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -3676,7 +3676,7 @@ ServiceDescriptorProto::~ServiceDescriptorProto() { } void ServiceDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (this != default_instance_) { @@ -3708,7 +3708,7 @@ ServiceDescriptorProto* ServiceDescriptorProto::New() const { void ServiceDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } @@ -3983,9 +3983,9 @@ MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) void MethodDescriptorProto::SharedCtor() { _cached_size_ = 0; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); options_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -3995,13 +3995,13 @@ MethodDescriptorProto::~MethodDescriptorProto() { } void MethodDescriptorProto::SharedDtor() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } - if (input_type_ != &::google::protobuf::internal::kEmptyString) { + if (input_type_ != &::google::protobuf::internal::GetEmptyString()) { delete input_type_; } - if (output_type_ != &::google::protobuf::internal::kEmptyString) { + if (output_type_ != &::google::protobuf::internal::GetEmptyString()) { delete output_type_; } if (this != default_instance_) { @@ -4033,17 +4033,17 @@ MethodDescriptorProto* MethodDescriptorProto::New() const { void MethodDescriptorProto::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name()) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } } if (has_input_type()) { - if (input_type_ != &::google::protobuf::internal::kEmptyString) { + if (input_type_ != &::google::protobuf::internal::GetEmptyString()) { input_type_->clear(); } } if (has_output_type()) { - if (output_type_ != &::google::protobuf::internal::kEmptyString) { + if (output_type_ != &::google::protobuf::internal::GetEmptyString()) { output_type_->clear(); } } @@ -4399,13 +4399,13 @@ FileOptions::FileOptions(const FileOptions& from) void FileOptions::SharedCtor() { _cached_size_ = 0; - java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); java_multiple_files_ = false; retain_unknown_fields_ = false; java_generate_equals_and_hash_ = false; optimize_for_ = 1; - go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); cc_generic_services_ = false; java_generic_services_ = false; py_generic_services_ = false; @@ -4417,13 +4417,13 @@ FileOptions::~FileOptions() { } void FileOptions::SharedDtor() { - if (java_package_ != &::google::protobuf::internal::kEmptyString) { + if (java_package_ != &::google::protobuf::internal::GetEmptyString()) { delete java_package_; } - if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ != &::google::protobuf::internal::GetEmptyString()) { delete java_outer_classname_; } - if (go_package_ != &::google::protobuf::internal::kEmptyString) { + if (go_package_ != &::google::protobuf::internal::GetEmptyString()) { delete go_package_; } if (this != default_instance_) { @@ -4455,12 +4455,12 @@ void FileOptions::Clear() { _extensions_.Clear(); if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_java_package()) { - if (java_package_ != &::google::protobuf::internal::kEmptyString) { + if (java_package_ != &::google::protobuf::internal::GetEmptyString()) { java_package_->clear(); } } if (has_java_outer_classname()) { - if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ != &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_->clear(); } } @@ -4469,7 +4469,7 @@ void FileOptions::Clear() { java_generate_equals_and_hash_ = false; optimize_for_ = 1; if (has_go_package()) { - if (go_package_ != &::google::protobuf::internal::kEmptyString) { + if (go_package_ != &::google::protobuf::internal::GetEmptyString()) { go_package_->clear(); } } @@ -5409,7 +5409,7 @@ void FieldOptions::SharedCtor() { packed_ = false; lazy_ = false; deprecated_ = false; - experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); weak_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -5419,7 +5419,7 @@ FieldOptions::~FieldOptions() { } void FieldOptions::SharedDtor() { - if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ != &::google::protobuf::internal::GetEmptyString()) { delete experimental_map_key_; } if (this != default_instance_) { @@ -5455,7 +5455,7 @@ void FieldOptions::Clear() { lazy_ = false; deprecated_ = false; if (has_experimental_map_key()) { - if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ != &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_->clear(); } } @@ -6828,7 +6828,7 @@ UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOp void UninterpretedOption_NamePart::SharedCtor() { _cached_size_ = 0; - name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); is_extension_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -6838,7 +6838,7 @@ UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { } void UninterpretedOption_NamePart::SharedDtor() { - if (name_part_ != &::google::protobuf::internal::kEmptyString) { + if (name_part_ != &::google::protobuf::internal::GetEmptyString()) { delete name_part_; } if (this != default_instance_) { @@ -6869,7 +6869,7 @@ UninterpretedOption_NamePart* UninterpretedOption_NamePart::New() const { void UninterpretedOption_NamePart::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_name_part()) { - if (name_part_ != &::google::protobuf::internal::kEmptyString) { + if (name_part_ != &::google::protobuf::internal::GetEmptyString()) { name_part_->clear(); } } @@ -7097,12 +7097,12 @@ UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) void UninterpretedOption::SharedCtor() { _cached_size_ = 0; - identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); positive_int_value_ = GOOGLE_ULONGLONG(0); negative_int_value_ = GOOGLE_LONGLONG(0); double_value_ = 0; - string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -7111,13 +7111,13 @@ UninterpretedOption::~UninterpretedOption() { } void UninterpretedOption::SharedDtor() { - if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ != &::google::protobuf::internal::GetEmptyString()) { delete identifier_value_; } - if (string_value_ != &::google::protobuf::internal::kEmptyString) { + if (string_value_ != &::google::protobuf::internal::GetEmptyString()) { delete string_value_; } - if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ != &::google::protobuf::internal::GetEmptyString()) { delete aggregate_value_; } if (this != default_instance_) { @@ -7148,7 +7148,7 @@ UninterpretedOption* UninterpretedOption::New() const { void UninterpretedOption::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (has_identifier_value()) { - if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ != &::google::protobuf::internal::GetEmptyString()) { identifier_value_->clear(); } } @@ -7156,12 +7156,12 @@ void UninterpretedOption::Clear() { negative_int_value_ = GOOGLE_LONGLONG(0); double_value_ = 0; if (has_string_value()) { - if (string_value_ != &::google::protobuf::internal::kEmptyString) { + if (string_value_ != &::google::protobuf::internal::GetEmptyString()) { string_value_->clear(); } } if (has_aggregate_value()) { - if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ != &::google::protobuf::internal::GetEmptyString()) { aggregate_value_->clear(); } } @@ -7586,8 +7586,8 @@ SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& void SourceCodeInfo_Location::SharedCtor() { _cached_size_ = 0; - leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); + trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -7596,10 +7596,10 @@ SourceCodeInfo_Location::~SourceCodeInfo_Location() { } void SourceCodeInfo_Location::SharedDtor() { - if (leading_comments_ != &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ != &::google::protobuf::internal::GetEmptyString()) { delete leading_comments_; } - if (trailing_comments_ != &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ != &::google::protobuf::internal::GetEmptyString()) { delete trailing_comments_; } if (this != default_instance_) { @@ -7630,12 +7630,12 @@ SourceCodeInfo_Location* SourceCodeInfo_Location::New() const { void SourceCodeInfo_Location::Clear() { if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { if (has_leading_comments()) { - if (leading_comments_ != &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ != &::google::protobuf::internal::GetEmptyString()) { leading_comments_->clear(); } } if (has_trailing_comments()) { - if (trailing_comments_ != &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ != &::google::protobuf::internal::GetEmptyString()) { trailing_comments_->clear(); } } diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.h b/third_party/protobuf/src/google/protobuf/descriptor.pb.h index f6b83cea5aee..e9990d147218 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.h +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.h @@ -2815,7 +2815,7 @@ inline void FileDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void FileDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -2825,44 +2825,44 @@ inline const ::std::string& FileDescriptorProto::name() const { } inline void FileDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void FileDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void FileDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* FileDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* FileDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FileDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -2870,7 +2870,7 @@ inline void FileDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -2885,7 +2885,7 @@ inline void FileDescriptorProto::clear_has_package() { _has_bits_[0] &= ~0x00000002u; } inline void FileDescriptorProto::clear_package() { - if (package_ != &::google::protobuf::internal::kEmptyString) { + if (package_ != &::google::protobuf::internal::GetEmptyString()) { package_->clear(); } clear_has_package(); @@ -2895,44 +2895,44 @@ inline const ::std::string& FileDescriptorProto::package() const { } inline void FileDescriptorProto::set_package(const ::std::string& value) { set_has_package(); - if (package_ == &::google::protobuf::internal::kEmptyString) { + if (package_ == &::google::protobuf::internal::GetEmptyString()) { package_ = new ::std::string; } package_->assign(value); } inline void FileDescriptorProto::set_package(const char* value) { set_has_package(); - if (package_ == &::google::protobuf::internal::kEmptyString) { + if (package_ == &::google::protobuf::internal::GetEmptyString()) { package_ = new ::std::string; } package_->assign(value); } inline void FileDescriptorProto::set_package(const char* value, size_t size) { set_has_package(); - if (package_ == &::google::protobuf::internal::kEmptyString) { + if (package_ == &::google::protobuf::internal::GetEmptyString()) { package_ = new ::std::string; } package_->assign(reinterpret_cast(value), size); } inline ::std::string* FileDescriptorProto::mutable_package() { set_has_package(); - if (package_ == &::google::protobuf::internal::kEmptyString) { + if (package_ == &::google::protobuf::internal::GetEmptyString()) { package_ = new ::std::string; } return package_; } inline ::std::string* FileDescriptorProto::release_package() { clear_has_package(); - if (package_ == &::google::protobuf::internal::kEmptyString) { + if (package_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = package_; - package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FileDescriptorProto::set_allocated_package(::std::string* package) { - if (package_ != &::google::protobuf::internal::kEmptyString) { + if (package_ != &::google::protobuf::internal::GetEmptyString()) { delete package_; } if (package) { @@ -2940,7 +2940,7 @@ inline void FileDescriptorProto::set_allocated_package(::std::string* package) { package_ = package; } else { clear_has_package(); - package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3277,7 +3277,7 @@ inline void DescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void DescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -3287,44 +3287,44 @@ inline const ::std::string& DescriptorProto::name() const { } inline void DescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void DescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void DescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* DescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* DescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void DescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -3332,7 +3332,7 @@ inline void DescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3514,7 +3514,7 @@ inline void FieldDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void FieldDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -3524,44 +3524,44 @@ inline const ::std::string& FieldDescriptorProto::name() const { } inline void FieldDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void FieldDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void FieldDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* FieldDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* FieldDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -3569,7 +3569,7 @@ inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3652,7 +3652,7 @@ inline void FieldDescriptorProto::clear_has_type_name() { _has_bits_[0] &= ~0x00000010u; } inline void FieldDescriptorProto::clear_type_name() { - if (type_name_ != &::google::protobuf::internal::kEmptyString) { + if (type_name_ != &::google::protobuf::internal::GetEmptyString()) { type_name_->clear(); } clear_has_type_name(); @@ -3662,44 +3662,44 @@ inline const ::std::string& FieldDescriptorProto::type_name() const { } inline void FieldDescriptorProto::set_type_name(const ::std::string& value) { set_has_type_name(); - if (type_name_ == &::google::protobuf::internal::kEmptyString) { + if (type_name_ == &::google::protobuf::internal::GetEmptyString()) { type_name_ = new ::std::string; } type_name_->assign(value); } inline void FieldDescriptorProto::set_type_name(const char* value) { set_has_type_name(); - if (type_name_ == &::google::protobuf::internal::kEmptyString) { + if (type_name_ == &::google::protobuf::internal::GetEmptyString()) { type_name_ = new ::std::string; } type_name_->assign(value); } inline void FieldDescriptorProto::set_type_name(const char* value, size_t size) { set_has_type_name(); - if (type_name_ == &::google::protobuf::internal::kEmptyString) { + if (type_name_ == &::google::protobuf::internal::GetEmptyString()) { type_name_ = new ::std::string; } type_name_->assign(reinterpret_cast(value), size); } inline ::std::string* FieldDescriptorProto::mutable_type_name() { set_has_type_name(); - if (type_name_ == &::google::protobuf::internal::kEmptyString) { + if (type_name_ == &::google::protobuf::internal::GetEmptyString()) { type_name_ = new ::std::string; } return type_name_; } inline ::std::string* FieldDescriptorProto::release_type_name() { clear_has_type_name(); - if (type_name_ == &::google::protobuf::internal::kEmptyString) { + if (type_name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = type_name_; - type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { - if (type_name_ != &::google::protobuf::internal::kEmptyString) { + if (type_name_ != &::google::protobuf::internal::GetEmptyString()) { delete type_name_; } if (type_name) { @@ -3707,7 +3707,7 @@ inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_na type_name_ = type_name; } else { clear_has_type_name(); - type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3722,7 +3722,7 @@ inline void FieldDescriptorProto::clear_has_extendee() { _has_bits_[0] &= ~0x00000020u; } inline void FieldDescriptorProto::clear_extendee() { - if (extendee_ != &::google::protobuf::internal::kEmptyString) { + if (extendee_ != &::google::protobuf::internal::GetEmptyString()) { extendee_->clear(); } clear_has_extendee(); @@ -3732,44 +3732,44 @@ inline const ::std::string& FieldDescriptorProto::extendee() const { } inline void FieldDescriptorProto::set_extendee(const ::std::string& value) { set_has_extendee(); - if (extendee_ == &::google::protobuf::internal::kEmptyString) { + if (extendee_ == &::google::protobuf::internal::GetEmptyString()) { extendee_ = new ::std::string; } extendee_->assign(value); } inline void FieldDescriptorProto::set_extendee(const char* value) { set_has_extendee(); - if (extendee_ == &::google::protobuf::internal::kEmptyString) { + if (extendee_ == &::google::protobuf::internal::GetEmptyString()) { extendee_ = new ::std::string; } extendee_->assign(value); } inline void FieldDescriptorProto::set_extendee(const char* value, size_t size) { set_has_extendee(); - if (extendee_ == &::google::protobuf::internal::kEmptyString) { + if (extendee_ == &::google::protobuf::internal::GetEmptyString()) { extendee_ = new ::std::string; } extendee_->assign(reinterpret_cast(value), size); } inline ::std::string* FieldDescriptorProto::mutable_extendee() { set_has_extendee(); - if (extendee_ == &::google::protobuf::internal::kEmptyString) { + if (extendee_ == &::google::protobuf::internal::GetEmptyString()) { extendee_ = new ::std::string; } return extendee_; } inline ::std::string* FieldDescriptorProto::release_extendee() { clear_has_extendee(); - if (extendee_ == &::google::protobuf::internal::kEmptyString) { + if (extendee_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = extendee_; - extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { - if (extendee_ != &::google::protobuf::internal::kEmptyString) { + if (extendee_ != &::google::protobuf::internal::GetEmptyString()) { delete extendee_; } if (extendee) { @@ -3777,7 +3777,7 @@ inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee extendee_ = extendee; } else { clear_has_extendee(); - extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3792,7 +3792,7 @@ inline void FieldDescriptorProto::clear_has_default_value() { _has_bits_[0] &= ~0x00000040u; } inline void FieldDescriptorProto::clear_default_value() { - if (default_value_ != &::google::protobuf::internal::kEmptyString) { + if (default_value_ != &::google::protobuf::internal::GetEmptyString()) { default_value_->clear(); } clear_has_default_value(); @@ -3802,44 +3802,44 @@ inline const ::std::string& FieldDescriptorProto::default_value() const { } inline void FieldDescriptorProto::set_default_value(const ::std::string& value) { set_has_default_value(); - if (default_value_ == &::google::protobuf::internal::kEmptyString) { + if (default_value_ == &::google::protobuf::internal::GetEmptyString()) { default_value_ = new ::std::string; } default_value_->assign(value); } inline void FieldDescriptorProto::set_default_value(const char* value) { set_has_default_value(); - if (default_value_ == &::google::protobuf::internal::kEmptyString) { + if (default_value_ == &::google::protobuf::internal::GetEmptyString()) { default_value_ = new ::std::string; } default_value_->assign(value); } inline void FieldDescriptorProto::set_default_value(const char* value, size_t size) { set_has_default_value(); - if (default_value_ == &::google::protobuf::internal::kEmptyString) { + if (default_value_ == &::google::protobuf::internal::GetEmptyString()) { default_value_ = new ::std::string; } default_value_->assign(reinterpret_cast(value), size); } inline ::std::string* FieldDescriptorProto::mutable_default_value() { set_has_default_value(); - if (default_value_ == &::google::protobuf::internal::kEmptyString) { + if (default_value_ == &::google::protobuf::internal::GetEmptyString()) { default_value_ = new ::std::string; } return default_value_; } inline ::std::string* FieldDescriptorProto::release_default_value() { clear_has_default_value(); - if (default_value_ == &::google::protobuf::internal::kEmptyString) { + if (default_value_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = default_value_; - default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { - if (default_value_ != &::google::protobuf::internal::kEmptyString) { + if (default_value_ != &::google::protobuf::internal::GetEmptyString()) { delete default_value_; } if (default_value) { @@ -3847,7 +3847,7 @@ inline void FieldDescriptorProto::set_allocated_default_value(::std::string* def default_value_ = default_value; } else { clear_has_default_value(); - default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -3904,7 +3904,7 @@ inline void EnumDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void EnumDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -3914,44 +3914,44 @@ inline const ::std::string& EnumDescriptorProto::name() const { } inline void EnumDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void EnumDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void EnumDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* EnumDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* EnumDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -3959,7 +3959,7 @@ inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4041,7 +4041,7 @@ inline void EnumValueDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void EnumValueDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -4051,44 +4051,44 @@ inline const ::std::string& EnumValueDescriptorProto::name() const { } inline void EnumValueDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void EnumValueDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void EnumValueDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* EnumValueDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* EnumValueDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -4096,7 +4096,7 @@ inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4175,7 +4175,7 @@ inline void ServiceDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void ServiceDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -4185,44 +4185,44 @@ inline const ::std::string& ServiceDescriptorProto::name() const { } inline void ServiceDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void ServiceDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void ServiceDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* ServiceDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* ServiceDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -4230,7 +4230,7 @@ inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4312,7 +4312,7 @@ inline void MethodDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void MethodDescriptorProto::clear_name() { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { name_->clear(); } clear_has_name(); @@ -4322,44 +4322,44 @@ inline const ::std::string& MethodDescriptorProto::name() const { } inline void MethodDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void MethodDescriptorProto::set_name(const char* value) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(value); } inline void MethodDescriptorProto::set_name(const char* value, size_t size) { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } name_->assign(reinterpret_cast(value), size); } inline ::std::string* MethodDescriptorProto::mutable_name() { set_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { name_ = new ::std::string; } return name_; } inline ::std::string* MethodDescriptorProto::release_name() { clear_has_name(); - if (name_ == &::google::protobuf::internal::kEmptyString) { + if (name_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_; - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { - if (name_ != &::google::protobuf::internal::kEmptyString) { + if (name_ != &::google::protobuf::internal::GetEmptyString()) { delete name_; } if (name) { @@ -4367,7 +4367,7 @@ inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { name_ = name; } else { clear_has_name(); - name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4382,7 +4382,7 @@ inline void MethodDescriptorProto::clear_has_input_type() { _has_bits_[0] &= ~0x00000002u; } inline void MethodDescriptorProto::clear_input_type() { - if (input_type_ != &::google::protobuf::internal::kEmptyString) { + if (input_type_ != &::google::protobuf::internal::GetEmptyString()) { input_type_->clear(); } clear_has_input_type(); @@ -4392,44 +4392,44 @@ inline const ::std::string& MethodDescriptorProto::input_type() const { } inline void MethodDescriptorProto::set_input_type(const ::std::string& value) { set_has_input_type(); - if (input_type_ == &::google::protobuf::internal::kEmptyString) { + if (input_type_ == &::google::protobuf::internal::GetEmptyString()) { input_type_ = new ::std::string; } input_type_->assign(value); } inline void MethodDescriptorProto::set_input_type(const char* value) { set_has_input_type(); - if (input_type_ == &::google::protobuf::internal::kEmptyString) { + if (input_type_ == &::google::protobuf::internal::GetEmptyString()) { input_type_ = new ::std::string; } input_type_->assign(value); } inline void MethodDescriptorProto::set_input_type(const char* value, size_t size) { set_has_input_type(); - if (input_type_ == &::google::protobuf::internal::kEmptyString) { + if (input_type_ == &::google::protobuf::internal::GetEmptyString()) { input_type_ = new ::std::string; } input_type_->assign(reinterpret_cast(value), size); } inline ::std::string* MethodDescriptorProto::mutable_input_type() { set_has_input_type(); - if (input_type_ == &::google::protobuf::internal::kEmptyString) { + if (input_type_ == &::google::protobuf::internal::GetEmptyString()) { input_type_ = new ::std::string; } return input_type_; } inline ::std::string* MethodDescriptorProto::release_input_type() { clear_has_input_type(); - if (input_type_ == &::google::protobuf::internal::kEmptyString) { + if (input_type_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = input_type_; - input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { - if (input_type_ != &::google::protobuf::internal::kEmptyString) { + if (input_type_ != &::google::protobuf::internal::GetEmptyString()) { delete input_type_; } if (input_type) { @@ -4437,7 +4437,7 @@ inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input input_type_ = input_type; } else { clear_has_input_type(); - input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4452,7 +4452,7 @@ inline void MethodDescriptorProto::clear_has_output_type() { _has_bits_[0] &= ~0x00000004u; } inline void MethodDescriptorProto::clear_output_type() { - if (output_type_ != &::google::protobuf::internal::kEmptyString) { + if (output_type_ != &::google::protobuf::internal::GetEmptyString()) { output_type_->clear(); } clear_has_output_type(); @@ -4462,44 +4462,44 @@ inline const ::std::string& MethodDescriptorProto::output_type() const { } inline void MethodDescriptorProto::set_output_type(const ::std::string& value) { set_has_output_type(); - if (output_type_ == &::google::protobuf::internal::kEmptyString) { + if (output_type_ == &::google::protobuf::internal::GetEmptyString()) { output_type_ = new ::std::string; } output_type_->assign(value); } inline void MethodDescriptorProto::set_output_type(const char* value) { set_has_output_type(); - if (output_type_ == &::google::protobuf::internal::kEmptyString) { + if (output_type_ == &::google::protobuf::internal::GetEmptyString()) { output_type_ = new ::std::string; } output_type_->assign(value); } inline void MethodDescriptorProto::set_output_type(const char* value, size_t size) { set_has_output_type(); - if (output_type_ == &::google::protobuf::internal::kEmptyString) { + if (output_type_ == &::google::protobuf::internal::GetEmptyString()) { output_type_ = new ::std::string; } output_type_->assign(reinterpret_cast(value), size); } inline ::std::string* MethodDescriptorProto::mutable_output_type() { set_has_output_type(); - if (output_type_ == &::google::protobuf::internal::kEmptyString) { + if (output_type_ == &::google::protobuf::internal::GetEmptyString()) { output_type_ = new ::std::string; } return output_type_; } inline ::std::string* MethodDescriptorProto::release_output_type() { clear_has_output_type(); - if (output_type_ == &::google::protobuf::internal::kEmptyString) { + if (output_type_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = output_type_; - output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { - if (output_type_ != &::google::protobuf::internal::kEmptyString) { + if (output_type_ != &::google::protobuf::internal::GetEmptyString()) { delete output_type_; } if (output_type) { @@ -4507,7 +4507,7 @@ inline void MethodDescriptorProto::set_allocated_output_type(::std::string* outp output_type_ = output_type; } else { clear_has_output_type(); - output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4564,7 +4564,7 @@ inline void FileOptions::clear_has_java_package() { _has_bits_[0] &= ~0x00000001u; } inline void FileOptions::clear_java_package() { - if (java_package_ != &::google::protobuf::internal::kEmptyString) { + if (java_package_ != &::google::protobuf::internal::GetEmptyString()) { java_package_->clear(); } clear_has_java_package(); @@ -4574,44 +4574,44 @@ inline const ::std::string& FileOptions::java_package() const { } inline void FileOptions::set_java_package(const ::std::string& value) { set_has_java_package(); - if (java_package_ == &::google::protobuf::internal::kEmptyString) { + if (java_package_ == &::google::protobuf::internal::GetEmptyString()) { java_package_ = new ::std::string; } java_package_->assign(value); } inline void FileOptions::set_java_package(const char* value) { set_has_java_package(); - if (java_package_ == &::google::protobuf::internal::kEmptyString) { + if (java_package_ == &::google::protobuf::internal::GetEmptyString()) { java_package_ = new ::std::string; } java_package_->assign(value); } inline void FileOptions::set_java_package(const char* value, size_t size) { set_has_java_package(); - if (java_package_ == &::google::protobuf::internal::kEmptyString) { + if (java_package_ == &::google::protobuf::internal::GetEmptyString()) { java_package_ = new ::std::string; } java_package_->assign(reinterpret_cast(value), size); } inline ::std::string* FileOptions::mutable_java_package() { set_has_java_package(); - if (java_package_ == &::google::protobuf::internal::kEmptyString) { + if (java_package_ == &::google::protobuf::internal::GetEmptyString()) { java_package_ = new ::std::string; } return java_package_; } inline ::std::string* FileOptions::release_java_package() { clear_has_java_package(); - if (java_package_ == &::google::protobuf::internal::kEmptyString) { + if (java_package_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = java_package_; - java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FileOptions::set_allocated_java_package(::std::string* java_package) { - if (java_package_ != &::google::protobuf::internal::kEmptyString) { + if (java_package_ != &::google::protobuf::internal::GetEmptyString()) { delete java_package_; } if (java_package) { @@ -4619,7 +4619,7 @@ inline void FileOptions::set_allocated_java_package(::std::string* java_package) java_package_ = java_package; } else { clear_has_java_package(); - java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4634,7 +4634,7 @@ inline void FileOptions::clear_has_java_outer_classname() { _has_bits_[0] &= ~0x00000002u; } inline void FileOptions::clear_java_outer_classname() { - if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ != &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_->clear(); } clear_has_java_outer_classname(); @@ -4644,44 +4644,44 @@ inline const ::std::string& FileOptions::java_outer_classname() const { } inline void FileOptions::set_java_outer_classname(const ::std::string& value) { set_has_java_outer_classname(); - if (java_outer_classname_ == &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ == &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_ = new ::std::string; } java_outer_classname_->assign(value); } inline void FileOptions::set_java_outer_classname(const char* value) { set_has_java_outer_classname(); - if (java_outer_classname_ == &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ == &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_ = new ::std::string; } java_outer_classname_->assign(value); } inline void FileOptions::set_java_outer_classname(const char* value, size_t size) { set_has_java_outer_classname(); - if (java_outer_classname_ == &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ == &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_ = new ::std::string; } java_outer_classname_->assign(reinterpret_cast(value), size); } inline ::std::string* FileOptions::mutable_java_outer_classname() { set_has_java_outer_classname(); - if (java_outer_classname_ == &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ == &::google::protobuf::internal::GetEmptyString()) { java_outer_classname_ = new ::std::string; } return java_outer_classname_; } inline ::std::string* FileOptions::release_java_outer_classname() { clear_has_java_outer_classname(); - if (java_outer_classname_ == &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = java_outer_classname_; - java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { - if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { + if (java_outer_classname_ != &::google::protobuf::internal::GetEmptyString()) { delete java_outer_classname_; } if (java_outer_classname) { @@ -4689,7 +4689,7 @@ inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_ java_outer_classname_ = java_outer_classname; } else { clear_has_java_outer_classname(); - java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -4793,7 +4793,7 @@ inline void FileOptions::clear_has_go_package() { _has_bits_[0] &= ~0x00000040u; } inline void FileOptions::clear_go_package() { - if (go_package_ != &::google::protobuf::internal::kEmptyString) { + if (go_package_ != &::google::protobuf::internal::GetEmptyString()) { go_package_->clear(); } clear_has_go_package(); @@ -4803,44 +4803,44 @@ inline const ::std::string& FileOptions::go_package() const { } inline void FileOptions::set_go_package(const ::std::string& value) { set_has_go_package(); - if (go_package_ == &::google::protobuf::internal::kEmptyString) { + if (go_package_ == &::google::protobuf::internal::GetEmptyString()) { go_package_ = new ::std::string; } go_package_->assign(value); } inline void FileOptions::set_go_package(const char* value) { set_has_go_package(); - if (go_package_ == &::google::protobuf::internal::kEmptyString) { + if (go_package_ == &::google::protobuf::internal::GetEmptyString()) { go_package_ = new ::std::string; } go_package_->assign(value); } inline void FileOptions::set_go_package(const char* value, size_t size) { set_has_go_package(); - if (go_package_ == &::google::protobuf::internal::kEmptyString) { + if (go_package_ == &::google::protobuf::internal::GetEmptyString()) { go_package_ = new ::std::string; } go_package_->assign(reinterpret_cast(value), size); } inline ::std::string* FileOptions::mutable_go_package() { set_has_go_package(); - if (go_package_ == &::google::protobuf::internal::kEmptyString) { + if (go_package_ == &::google::protobuf::internal::GetEmptyString()) { go_package_ = new ::std::string; } return go_package_; } inline ::std::string* FileOptions::release_go_package() { clear_has_go_package(); - if (go_package_ == &::google::protobuf::internal::kEmptyString) { + if (go_package_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = go_package_; - go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FileOptions::set_allocated_go_package(::std::string* go_package) { - if (go_package_ != &::google::protobuf::internal::kEmptyString) { + if (go_package_ != &::google::protobuf::internal::GetEmptyString()) { delete go_package_; } if (go_package) { @@ -4848,7 +4848,7 @@ inline void FileOptions::set_allocated_go_package(::std::string* go_package) { go_package_ = go_package; } else { clear_has_go_package(); - go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + go_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5120,7 +5120,7 @@ inline void FieldOptions::clear_has_experimental_map_key() { _has_bits_[0] &= ~0x00000010u; } inline void FieldOptions::clear_experimental_map_key() { - if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ != &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_->clear(); } clear_has_experimental_map_key(); @@ -5130,44 +5130,44 @@ inline const ::std::string& FieldOptions::experimental_map_key() const { } inline void FieldOptions::set_experimental_map_key(const ::std::string& value) { set_has_experimental_map_key(); - if (experimental_map_key_ == &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ == &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_ = new ::std::string; } experimental_map_key_->assign(value); } inline void FieldOptions::set_experimental_map_key(const char* value) { set_has_experimental_map_key(); - if (experimental_map_key_ == &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ == &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_ = new ::std::string; } experimental_map_key_->assign(value); } inline void FieldOptions::set_experimental_map_key(const char* value, size_t size) { set_has_experimental_map_key(); - if (experimental_map_key_ == &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ == &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_ = new ::std::string; } experimental_map_key_->assign(reinterpret_cast(value), size); } inline ::std::string* FieldOptions::mutable_experimental_map_key() { set_has_experimental_map_key(); - if (experimental_map_key_ == &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ == &::google::protobuf::internal::GetEmptyString()) { experimental_map_key_ = new ::std::string; } return experimental_map_key_; } inline ::std::string* FieldOptions::release_experimental_map_key() { clear_has_experimental_map_key(); - if (experimental_map_key_ == &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = experimental_map_key_; - experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void FieldOptions::set_allocated_experimental_map_key(::std::string* experimental_map_key) { - if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { + if (experimental_map_key_ != &::google::protobuf::internal::GetEmptyString()) { delete experimental_map_key_; } if (experimental_map_key) { @@ -5175,7 +5175,7 @@ inline void FieldOptions::set_allocated_experimental_map_key(::std::string* expe experimental_map_key_ = experimental_map_key; } else { clear_has_experimental_map_key(); - experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5379,7 +5379,7 @@ inline void UninterpretedOption_NamePart::clear_has_name_part() { _has_bits_[0] &= ~0x00000001u; } inline void UninterpretedOption_NamePart::clear_name_part() { - if (name_part_ != &::google::protobuf::internal::kEmptyString) { + if (name_part_ != &::google::protobuf::internal::GetEmptyString()) { name_part_->clear(); } clear_has_name_part(); @@ -5389,44 +5389,44 @@ inline const ::std::string& UninterpretedOption_NamePart::name_part() const { } inline void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) { set_has_name_part(); - if (name_part_ == &::google::protobuf::internal::kEmptyString) { + if (name_part_ == &::google::protobuf::internal::GetEmptyString()) { name_part_ = new ::std::string; } name_part_->assign(value); } inline void UninterpretedOption_NamePart::set_name_part(const char* value) { set_has_name_part(); - if (name_part_ == &::google::protobuf::internal::kEmptyString) { + if (name_part_ == &::google::protobuf::internal::GetEmptyString()) { name_part_ = new ::std::string; } name_part_->assign(value); } inline void UninterpretedOption_NamePart::set_name_part(const char* value, size_t size) { set_has_name_part(); - if (name_part_ == &::google::protobuf::internal::kEmptyString) { + if (name_part_ == &::google::protobuf::internal::GetEmptyString()) { name_part_ = new ::std::string; } name_part_->assign(reinterpret_cast(value), size); } inline ::std::string* UninterpretedOption_NamePart::mutable_name_part() { set_has_name_part(); - if (name_part_ == &::google::protobuf::internal::kEmptyString) { + if (name_part_ == &::google::protobuf::internal::GetEmptyString()) { name_part_ = new ::std::string; } return name_part_; } inline ::std::string* UninterpretedOption_NamePart::release_name_part() { clear_has_name_part(); - if (name_part_ == &::google::protobuf::internal::kEmptyString) { + if (name_part_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = name_part_; - name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { - if (name_part_ != &::google::protobuf::internal::kEmptyString) { + if (name_part_ != &::google::protobuf::internal::GetEmptyString()) { delete name_part_; } if (name_part) { @@ -5434,7 +5434,7 @@ inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part_ = name_part; } else { clear_has_name_part(); - name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5500,7 +5500,7 @@ inline void UninterpretedOption::clear_has_identifier_value() { _has_bits_[0] &= ~0x00000002u; } inline void UninterpretedOption::clear_identifier_value() { - if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ != &::google::protobuf::internal::GetEmptyString()) { identifier_value_->clear(); } clear_has_identifier_value(); @@ -5510,44 +5510,44 @@ inline const ::std::string& UninterpretedOption::identifier_value() const { } inline void UninterpretedOption::set_identifier_value(const ::std::string& value) { set_has_identifier_value(); - if (identifier_value_ == &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ == &::google::protobuf::internal::GetEmptyString()) { identifier_value_ = new ::std::string; } identifier_value_->assign(value); } inline void UninterpretedOption::set_identifier_value(const char* value) { set_has_identifier_value(); - if (identifier_value_ == &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ == &::google::protobuf::internal::GetEmptyString()) { identifier_value_ = new ::std::string; } identifier_value_->assign(value); } inline void UninterpretedOption::set_identifier_value(const char* value, size_t size) { set_has_identifier_value(); - if (identifier_value_ == &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ == &::google::protobuf::internal::GetEmptyString()) { identifier_value_ = new ::std::string; } identifier_value_->assign(reinterpret_cast(value), size); } inline ::std::string* UninterpretedOption::mutable_identifier_value() { set_has_identifier_value(); - if (identifier_value_ == &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ == &::google::protobuf::internal::GetEmptyString()) { identifier_value_ = new ::std::string; } return identifier_value_; } inline ::std::string* UninterpretedOption::release_identifier_value() { clear_has_identifier_value(); - if (identifier_value_ == &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = identifier_value_; - identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { - if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { + if (identifier_value_ != &::google::protobuf::internal::GetEmptyString()) { delete identifier_value_; } if (identifier_value) { @@ -5555,7 +5555,7 @@ inline void UninterpretedOption::set_allocated_identifier_value(::std::string* i identifier_value_ = identifier_value; } else { clear_has_identifier_value(); - identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5636,7 +5636,7 @@ inline void UninterpretedOption::clear_has_string_value() { _has_bits_[0] &= ~0x00000020u; } inline void UninterpretedOption::clear_string_value() { - if (string_value_ != &::google::protobuf::internal::kEmptyString) { + if (string_value_ != &::google::protobuf::internal::GetEmptyString()) { string_value_->clear(); } clear_has_string_value(); @@ -5646,44 +5646,44 @@ inline const ::std::string& UninterpretedOption::string_value() const { } inline void UninterpretedOption::set_string_value(const ::std::string& value) { set_has_string_value(); - if (string_value_ == &::google::protobuf::internal::kEmptyString) { + if (string_value_ == &::google::protobuf::internal::GetEmptyString()) { string_value_ = new ::std::string; } string_value_->assign(value); } inline void UninterpretedOption::set_string_value(const char* value) { set_has_string_value(); - if (string_value_ == &::google::protobuf::internal::kEmptyString) { + if (string_value_ == &::google::protobuf::internal::GetEmptyString()) { string_value_ = new ::std::string; } string_value_->assign(value); } inline void UninterpretedOption::set_string_value(const void* value, size_t size) { set_has_string_value(); - if (string_value_ == &::google::protobuf::internal::kEmptyString) { + if (string_value_ == &::google::protobuf::internal::GetEmptyString()) { string_value_ = new ::std::string; } string_value_->assign(reinterpret_cast(value), size); } inline ::std::string* UninterpretedOption::mutable_string_value() { set_has_string_value(); - if (string_value_ == &::google::protobuf::internal::kEmptyString) { + if (string_value_ == &::google::protobuf::internal::GetEmptyString()) { string_value_ = new ::std::string; } return string_value_; } inline ::std::string* UninterpretedOption::release_string_value() { clear_has_string_value(); - if (string_value_ == &::google::protobuf::internal::kEmptyString) { + if (string_value_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = string_value_; - string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { - if (string_value_ != &::google::protobuf::internal::kEmptyString) { + if (string_value_ != &::google::protobuf::internal::GetEmptyString()) { delete string_value_; } if (string_value) { @@ -5691,7 +5691,7 @@ inline void UninterpretedOption::set_allocated_string_value(::std::string* strin string_value_ = string_value; } else { clear_has_string_value(); - string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5706,7 +5706,7 @@ inline void UninterpretedOption::clear_has_aggregate_value() { _has_bits_[0] &= ~0x00000040u; } inline void UninterpretedOption::clear_aggregate_value() { - if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ != &::google::protobuf::internal::GetEmptyString()) { aggregate_value_->clear(); } clear_has_aggregate_value(); @@ -5716,44 +5716,44 @@ inline const ::std::string& UninterpretedOption::aggregate_value() const { } inline void UninterpretedOption::set_aggregate_value(const ::std::string& value) { set_has_aggregate_value(); - if (aggregate_value_ == &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ == &::google::protobuf::internal::GetEmptyString()) { aggregate_value_ = new ::std::string; } aggregate_value_->assign(value); } inline void UninterpretedOption::set_aggregate_value(const char* value) { set_has_aggregate_value(); - if (aggregate_value_ == &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ == &::google::protobuf::internal::GetEmptyString()) { aggregate_value_ = new ::std::string; } aggregate_value_->assign(value); } inline void UninterpretedOption::set_aggregate_value(const char* value, size_t size) { set_has_aggregate_value(); - if (aggregate_value_ == &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ == &::google::protobuf::internal::GetEmptyString()) { aggregate_value_ = new ::std::string; } aggregate_value_->assign(reinterpret_cast(value), size); } inline ::std::string* UninterpretedOption::mutable_aggregate_value() { set_has_aggregate_value(); - if (aggregate_value_ == &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ == &::google::protobuf::internal::GetEmptyString()) { aggregate_value_ = new ::std::string; } return aggregate_value_; } inline ::std::string* UninterpretedOption::release_aggregate_value() { clear_has_aggregate_value(); - if (aggregate_value_ == &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = aggregate_value_; - aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { - if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { + if (aggregate_value_ != &::google::protobuf::internal::GetEmptyString()) { delete aggregate_value_; } if (aggregate_value) { @@ -5761,7 +5761,7 @@ inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* ag aggregate_value_ = aggregate_value; } else { clear_has_aggregate_value(); - aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5830,7 +5830,7 @@ inline void SourceCodeInfo_Location::clear_has_leading_comments() { _has_bits_[0] &= ~0x00000004u; } inline void SourceCodeInfo_Location::clear_leading_comments() { - if (leading_comments_ != &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ != &::google::protobuf::internal::GetEmptyString()) { leading_comments_->clear(); } clear_has_leading_comments(); @@ -5840,44 +5840,44 @@ inline const ::std::string& SourceCodeInfo_Location::leading_comments() const { } inline void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) { set_has_leading_comments(); - if (leading_comments_ == &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ == &::google::protobuf::internal::GetEmptyString()) { leading_comments_ = new ::std::string; } leading_comments_->assign(value); } inline void SourceCodeInfo_Location::set_leading_comments(const char* value) { set_has_leading_comments(); - if (leading_comments_ == &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ == &::google::protobuf::internal::GetEmptyString()) { leading_comments_ = new ::std::string; } leading_comments_->assign(value); } inline void SourceCodeInfo_Location::set_leading_comments(const char* value, size_t size) { set_has_leading_comments(); - if (leading_comments_ == &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ == &::google::protobuf::internal::GetEmptyString()) { leading_comments_ = new ::std::string; } leading_comments_->assign(reinterpret_cast(value), size); } inline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() { set_has_leading_comments(); - if (leading_comments_ == &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ == &::google::protobuf::internal::GetEmptyString()) { leading_comments_ = new ::std::string; } return leading_comments_; } inline ::std::string* SourceCodeInfo_Location::release_leading_comments() { clear_has_leading_comments(); - if (leading_comments_ == &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = leading_comments_; - leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { - if (leading_comments_ != &::google::protobuf::internal::kEmptyString) { + if (leading_comments_ != &::google::protobuf::internal::GetEmptyString()) { delete leading_comments_; } if (leading_comments) { @@ -5885,7 +5885,7 @@ inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::strin leading_comments_ = leading_comments; } else { clear_has_leading_comments(); - leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + leading_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } @@ -5900,7 +5900,7 @@ inline void SourceCodeInfo_Location::clear_has_trailing_comments() { _has_bits_[0] &= ~0x00000008u; } inline void SourceCodeInfo_Location::clear_trailing_comments() { - if (trailing_comments_ != &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ != &::google::protobuf::internal::GetEmptyString()) { trailing_comments_->clear(); } clear_has_trailing_comments(); @@ -5910,44 +5910,44 @@ inline const ::std::string& SourceCodeInfo_Location::trailing_comments() const { } inline void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) { set_has_trailing_comments(); - if (trailing_comments_ == &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ == &::google::protobuf::internal::GetEmptyString()) { trailing_comments_ = new ::std::string; } trailing_comments_->assign(value); } inline void SourceCodeInfo_Location::set_trailing_comments(const char* value) { set_has_trailing_comments(); - if (trailing_comments_ == &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ == &::google::protobuf::internal::GetEmptyString()) { trailing_comments_ = new ::std::string; } trailing_comments_->assign(value); } inline void SourceCodeInfo_Location::set_trailing_comments(const char* value, size_t size) { set_has_trailing_comments(); - if (trailing_comments_ == &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ == &::google::protobuf::internal::GetEmptyString()) { trailing_comments_ = new ::std::string; } trailing_comments_->assign(reinterpret_cast(value), size); } inline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { set_has_trailing_comments(); - if (trailing_comments_ == &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ == &::google::protobuf::internal::GetEmptyString()) { trailing_comments_ = new ::std::string; } return trailing_comments_; } inline ::std::string* SourceCodeInfo_Location::release_trailing_comments() { clear_has_trailing_comments(); - if (trailing_comments_ == &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ == &::google::protobuf::internal::GetEmptyString()) { return NULL; } else { ::std::string* temp = trailing_comments_; - trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); return temp; } } inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { - if (trailing_comments_ != &::google::protobuf::internal::kEmptyString) { + if (trailing_comments_ != &::google::protobuf::internal::GetEmptyString()) { delete trailing_comments_; } if (trailing_comments) { @@ -5955,7 +5955,7 @@ inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::stri trailing_comments_ = trailing_comments; } else { clear_has_trailing_comments(); - trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + trailing_comments_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString()); } } diff --git a/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc b/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc index 09b06997ec60..56d6b2990d1e 100644 --- a/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc +++ b/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc @@ -56,7 +56,7 @@ bool ParseNamedEnum(const EnumDescriptor* descriptor, const string& NameOfEnum(const EnumDescriptor* descriptor, int value) { const EnumValueDescriptor* d = descriptor->FindValueByNumber(value); - return (d == NULL ? kEmptyString : d->name()); + return (d == NULL ? GetEmptyString() : d->name()); } // =================================================================== @@ -759,7 +759,7 @@ string GeneratedMessageReflection::GetString( } GOOGLE_LOG(FATAL) << "Can't get here."; - return kEmptyString; // Make compiler happy. + return GetEmptyString(); // Make compiler happy. } } @@ -778,7 +778,7 @@ const string& GeneratedMessageReflection::GetStringReference( } GOOGLE_LOG(FATAL) << "Can't get here."; - return kEmptyString; // Make compiler happy. + return GetEmptyString(); // Make compiler happy. } } @@ -820,7 +820,7 @@ string GeneratedMessageReflection::GetRepeatedString( } GOOGLE_LOG(FATAL) << "Can't get here."; - return kEmptyString; // Make compiler happy. + return GetEmptyString(); // Make compiler happy. } } @@ -838,7 +838,7 @@ const string& GeneratedMessageReflection::GetRepeatedStringReference( } GOOGLE_LOG(FATAL) << "Can't get here."; - return kEmptyString; // Make compiler happy. + return GetEmptyString(); // Make compiler happy. } } diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.cc b/third_party/protobuf/src/google/protobuf/generated_message_util.cc index ac32150146f2..794be3571053 100644 --- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.cc @@ -47,7 +47,12 @@ double NaN() { return std::numeric_limits::quiet_NaN(); } -const ::std::string kEmptyString; +const ::std::string* empty_string_; +ProtobufOnceType empty_string_once_init_; + +void InitEmptyString() { + empty_string_ = new std::string(); +} } // namespace internal } // namespace protobuf diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.h b/third_party/protobuf/src/google/protobuf/generated_message_util.h index b2fb8f0be2a2..098f3219806d 100644 --- a/third_party/protobuf/src/google/protobuf/generated_message_util.h +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.h @@ -41,6 +41,7 @@ #include #include +#include namespace google { namespace protobuf { namespace internal { @@ -59,8 +60,17 @@ namespace internal { LIBPROTOBUF_EXPORT double Infinity(); LIBPROTOBUF_EXPORT double NaN(); -// Constant used for empty default strings. -LIBPROTOBUF_EXPORT extern const ::std::string kEmptyString; +// Default empty string object. Don't use the pointer directly. Instead, call +// GetEmptyString() to get the reference. +LIBPROTOBUF_EXPORT extern const ::std::string* empty_string_; +LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_; + +LIBPROTOBUF_EXPORT void InitEmptyString(); + +LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString() { + GoogleOnceInit(&empty_string_once_init_, &InitEmptyString); + return *empty_string_; +} // Defined in generated_message_reflection.cc -- not actually part of the lite // library. diff --git a/third_party/protobuf/src/google/protobuf/repeated_field.h b/third_party/protobuf/src/google/protobuf/repeated_field.h index 570d4b751297..ff5d1f4b5f40 100644 --- a/third_party/protobuf/src/google/protobuf/repeated_field.h +++ b/third_party/protobuf/src/google/protobuf/repeated_field.h @@ -383,7 +383,7 @@ class LIBPROTOBUF_EXPORT StringTypeHandlerBase { static void Clear(string* value) { value->clear(); } static void Merge(const string& from, string* to) { *to = from; } static const Type& default_instance() { - return ::google::protobuf::internal::kEmptyString; + return ::google::protobuf::internal::GetEmptyString(); } }; -- 2.11.4.GIT