mirror of
https://github.com/opencv/opencv.git
synced 2025-07-26 07:07:37 +08:00
3rdparty(protobuf): fix build with Android NDK 16
This commit is contained in:
parent
bc6a355370
commit
b76a691bcf
@ -216,14 +216,14 @@ class FieldMaskTree {
|
|||||||
~Node() { ClearChildren(); }
|
~Node() { ClearChildren(); }
|
||||||
|
|
||||||
void ClearChildren() {
|
void ClearChildren() {
|
||||||
for (map<string, Node*>::iterator it = children.begin();
|
for (std::map<string, Node*>::iterator it = children.begin();
|
||||||
it != children.end(); ++it) {
|
it != children.end(); ++it) {
|
||||||
delete it->second;
|
delete it->second;
|
||||||
}
|
}
|
||||||
children.clear();
|
children.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
map<string, Node*> children;
|
std::map<string, Node*> children;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Node);
|
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Node);
|
||||||
@ -274,7 +274,7 @@ void FieldMaskTree::MergeToFieldMask(const string& prefix, const Node* node,
|
|||||||
out->add_paths(prefix);
|
out->add_paths(prefix);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (map<string, Node*>::const_iterator it = node->children.begin();
|
for (std::map<string, Node*>::const_iterator it = node->children.begin();
|
||||||
it != node->children.end(); ++it) {
|
it != node->children.end(); ++it) {
|
||||||
string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
|
string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
|
||||||
MergeToFieldMask(current_path, it->second, out);
|
MergeToFieldMask(current_path, it->second, out);
|
||||||
@ -339,7 +339,7 @@ void FieldMaskTree::MergeLeafNodesToTree(const string& prefix, const Node* node,
|
|||||||
if (node->children.empty()) {
|
if (node->children.empty()) {
|
||||||
out->AddPath(prefix);
|
out->AddPath(prefix);
|
||||||
}
|
}
|
||||||
for (map<string, Node*>::const_iterator it = node->children.begin();
|
for (std::map<string, Node*>::const_iterator it = node->children.begin();
|
||||||
it != node->children.end(); ++it) {
|
it != node->children.end(); ++it) {
|
||||||
string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
|
string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
|
||||||
MergeLeafNodesToTree(current_path, it->second, out);
|
MergeLeafNodesToTree(current_path, it->second, out);
|
||||||
@ -353,7 +353,7 @@ void FieldMaskTree::MergeMessage(const Node* node, const Message& source,
|
|||||||
const Reflection* source_reflection = source.GetReflection();
|
const Reflection* source_reflection = source.GetReflection();
|
||||||
const Reflection* destination_reflection = destination->GetReflection();
|
const Reflection* destination_reflection = destination->GetReflection();
|
||||||
const Descriptor* descriptor = source.GetDescriptor();
|
const Descriptor* descriptor = source.GetDescriptor();
|
||||||
for (map<string, Node*>::const_iterator it = node->children.begin();
|
for (std::map<string, Node*>::const_iterator it = node->children.begin();
|
||||||
it != node->children.end(); ++it) {
|
it != node->children.end(); ++it) {
|
||||||
const string& field_name = it->first;
|
const string& field_name = it->first;
|
||||||
const Node* child = it->second;
|
const Node* child = it->second;
|
||||||
@ -456,7 +456,7 @@ void FieldMaskTree::TrimMessage(const Node* node, Message* message) {
|
|||||||
const int32 field_count = descriptor->field_count();
|
const int32 field_count = descriptor->field_count();
|
||||||
for (int index = 0; index < field_count; ++index) {
|
for (int index = 0; index < field_count; ++index) {
|
||||||
const FieldDescriptor* field = descriptor->field(index);
|
const FieldDescriptor* field = descriptor->field(index);
|
||||||
map<string, Node*>::const_iterator it = node->children.find(field->name());
|
std::map<string, Node*>::const_iterator it = node->children.find(field->name());
|
||||||
if (it == node->children.end()) {
|
if (it == node->children.end()) {
|
||||||
reflection->ClearField(message, field);
|
reflection->ClearField(message, field);
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,7 +60,7 @@ class TypeInfoForTypeResolver : public TypeInfo {
|
|||||||
|
|
||||||
virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
|
virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
|
||||||
StringPiece type_url) const {
|
StringPiece type_url) const {
|
||||||
map<StringPiece, StatusOrType>::iterator it = cached_types_.find(type_url);
|
std::map<StringPiece, StatusOrType>::iterator it = cached_types_.find(type_url);
|
||||||
if (it != cached_types_.end()) {
|
if (it != cached_types_.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ class TypeInfoForTypeResolver : public TypeInfo {
|
|||||||
|
|
||||||
virtual const google::protobuf::Enum* GetEnumByTypeUrl(
|
virtual const google::protobuf::Enum* GetEnumByTypeUrl(
|
||||||
StringPiece type_url) const {
|
StringPiece type_url) const {
|
||||||
map<StringPiece, StatusOrEnum>::iterator it = cached_enums_.find(type_url);
|
std::map<StringPiece, StatusOrEnum>::iterator it = cached_enums_.find(type_url);
|
||||||
if (it != cached_enums_.end()) {
|
if (it != cached_enums_.end()) {
|
||||||
return it->second.ok() ? it->second.ValueOrDie() : NULL;
|
return it->second.ok() ? it->second.ValueOrDie() : NULL;
|
||||||
}
|
}
|
||||||
@ -123,8 +123,8 @@ class TypeInfoForTypeResolver : public TypeInfo {
|
|||||||
typedef util::StatusOr<const google::protobuf::Enum*> StatusOrEnum;
|
typedef util::StatusOr<const google::protobuf::Enum*> StatusOrEnum;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static void DeleteCachedTypes(map<StringPiece, T>* cached_types) {
|
static void DeleteCachedTypes(std::map<StringPiece, T>* cached_types) {
|
||||||
for (typename map<StringPiece, T>::iterator it = cached_types->begin();
|
for (typename std::map<StringPiece, T>::iterator it = cached_types->begin();
|
||||||
it != cached_types->end(); ++it) {
|
it != cached_types->end(); ++it) {
|
||||||
if (it->second.ok()) {
|
if (it->second.ok()) {
|
||||||
delete it->second.ValueOrDie();
|
delete it->second.ValueOrDie();
|
||||||
@ -153,11 +153,11 @@ class TypeInfoForTypeResolver : public TypeInfo {
|
|||||||
// cached_types_, cached_enums_ and camel_case_name_table_.
|
// cached_types_, cached_enums_ and camel_case_name_table_.
|
||||||
mutable set<string> string_storage_;
|
mutable set<string> string_storage_;
|
||||||
|
|
||||||
mutable map<StringPiece, StatusOrType> cached_types_;
|
mutable std::map<StringPiece, StatusOrType> cached_types_;
|
||||||
mutable map<StringPiece, StatusOrEnum> cached_enums_;
|
mutable std::map<StringPiece, StatusOrEnum> cached_enums_;
|
||||||
|
|
||||||
mutable set<const google::protobuf::Type*> indexed_types_;
|
mutable set<const google::protobuf::Type*> indexed_types_;
|
||||||
mutable map<StringPiece, StringPiece> camel_case_name_table_;
|
mutable std::map<StringPiece, StringPiece> camel_case_name_table_;
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -1284,7 +1284,7 @@ class MaximumMatcher {
|
|||||||
int count1_;
|
int count1_;
|
||||||
int count2_;
|
int count2_;
|
||||||
google::protobuf::scoped_ptr<NodeMatchCallback> match_callback_;
|
google::protobuf::scoped_ptr<NodeMatchCallback> match_callback_;
|
||||||
map<pair<int, int>, bool> cached_match_results_;
|
std::map<pair<int, int>, bool> cached_match_results_;
|
||||||
vector<int>* match_list1_;
|
vector<int>* match_list1_;
|
||||||
vector<int>* match_list2_;
|
vector<int>* match_list2_;
|
||||||
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MaximumMatcher);
|
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MaximumMatcher);
|
||||||
@ -1322,7 +1322,7 @@ int MaximumMatcher::FindMaximumMatch(bool early_return) {
|
|||||||
|
|
||||||
bool MaximumMatcher::Match(int left, int right) {
|
bool MaximumMatcher::Match(int left, int right) {
|
||||||
pair<int, int> p(left, right);
|
pair<int, int> p(left, right);
|
||||||
map<pair<int, int>, bool>::iterator it = cached_match_results_.find(p);
|
std::map<pair<int, int>, bool>::iterator it = cached_match_results_.find(p);
|
||||||
if (it != cached_match_results_.end()) {
|
if (it != cached_match_results_.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user