diff options
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs | 18 | ||||
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_message.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/compiler/plugin.pb.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/descriptor.pb.cc | 28 | ||||
-rwxr-xr-x | travis.sh | 14 |
6 files changed, 46 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml index bfe63d1d..9dc99b4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ script: env: - CONFIG=cpp - CONFIG=cpp_distcheck + - CONFIG=csharp - CONFIG=java_jdk6 - CONFIG=java_jdk7 - CONFIG=java_oracle7 diff --git a/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs b/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs index d1220e9c..cc4a50bb 100644 --- a/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs +++ b/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs @@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers {
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new ExtensionByNameMap(),
- new ExtensionByIdMap(),
+ new ExtensionByIdMap(new ExtensionIntPairEqualityComparer()),
true);
private readonly ExtensionByNameMap extensionsByName;
@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers /// </summary>
public static ExtensionRegistry CreateInstance()
{
- return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(), false);
+ return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(new ExtensionIntPairEqualityComparer()), false);
}
public ExtensionRegistry AsReadOnly()
@@ -216,5 +216,17 @@ namespace Google.ProtocolBuffers return msgType.Equals(other.msgType) && number == other.number;
}
}
+
+ internal class ExtensionIntPairEqualityComparer : IEqualityComparer<ExtensionIntPair>
+ {
+ public bool Equals(ExtensionIntPair x, ExtensionIntPair y)
+ {
+ return x.Equals(y);
+ }
+ public int GetHashCode(ExtensionIntPair obj)
+ {
+ return obj.GetHashCode();
+ }
+ }
}
-}
\ No newline at end of file +}
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index bafa36f5..98929b1e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -2096,7 +2096,7 @@ GenerateClear(io::Printer* printer) { } else { if (HasFieldPresence(descriptor_->file())) { printer->Print( - "if (_has_bits_[$index$ / 32] & $mask$) {\n", + "if (_has_bits_[$index$ / 32] & $mask$u) {\n", "index", SimpleItoa(i / 8 * 8), "mask", SimpleItoa(mask)); printer->Indent(); diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index fed1726a..d78b715e 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -724,7 +724,7 @@ CodeGeneratorResponse_File* CodeGeneratorResponse_File::New(::google::protobuf:: } void CodeGeneratorResponse_File::Clear() { - if (_has_bits_[0 / 32] & 7) { + if (_has_bits_[0 / 32] & 7u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 5ae36510..8968f362 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1139,7 +1139,7 @@ FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) } void FileDescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 3) { + if (_has_bits_[0 / 32] & 3u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -1147,7 +1147,7 @@ void FileDescriptorProto::Clear() { package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } } - if (_has_bits_[8 / 32] & 3584) { + if (_has_bits_[8 / 32] & 3584u) { if (has_options()) { if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); } @@ -2656,7 +2656,7 @@ DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const { } void DescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 129) { + if (_has_bits_[0 / 32] & 129u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -3613,7 +3613,7 @@ FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena } void FieldDescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 255) { + if (_has_bits_[0 / 32] & 255u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -4898,7 +4898,7 @@ EnumDescriptorProto* EnumDescriptorProto::New(::google::protobuf::Arena* arena) } void EnumDescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 5) { + if (_has_bits_[0 / 32] & 5u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -5369,7 +5369,7 @@ EnumValueDescriptorProto* EnumValueDescriptorProto::New(::google::protobuf::Aren } void EnumValueDescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 7) { + if (_has_bits_[0 / 32] & 7u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -5831,7 +5831,7 @@ ServiceDescriptorProto* ServiceDescriptorProto::New(::google::protobuf::Arena* a } void ServiceDescriptorProto::Clear() { - if (_has_bits_[0 / 32] & 5) { + if (_has_bits_[0 / 32] & 5u) { if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -6318,7 +6318,7 @@ void MethodDescriptorProto::Clear() { ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) - if (_has_bits_[0 / 32] & 63) { + if (_has_bits_[0 / 32] & 63u) { ZR_(client_streaming_, server_streaming_); if (has_name()) { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -7110,7 +7110,7 @@ void FileOptions::Clear() { ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) - if (_has_bits_[0 / 32] & 255) { + if (_has_bits_[0 / 32] & 255u) { ZR_(java_multiple_files_, cc_generic_services_); if (has_java_package()) { java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -7123,7 +7123,7 @@ void FileOptions::Clear() { go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } } - if (_has_bits_[8 / 32] & 16128) { + if (_has_bits_[8 / 32] & 16128u) { ZR_(java_generic_services_, cc_enable_arenas_); if (has_objc_class_prefix()) { objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -9054,7 +9054,7 @@ void FieldOptions::Clear() { ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) - if (_has_bits_[0 / 32] & 31) { + if (_has_bits_[0 / 32] & 31u) { ZR_(ctype_, weak_); } @@ -11109,7 +11109,7 @@ UninterpretedOption_NamePart* UninterpretedOption_NamePart::New(::google::protob } void UninterpretedOption_NamePart::Clear() { - if (_has_bits_[0 / 32] & 3) { + if (_has_bits_[0 / 32] & 3u) { if (has_name_part()) { name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -11434,7 +11434,7 @@ void UninterpretedOption::Clear() { ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) - if (_has_bits_[0 / 32] & 126) { + if (_has_bits_[0 / 32] & 126u) { ZR_(positive_int_value_, double_value_); if (has_identifier_value()) { identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -12284,7 +12284,7 @@ SourceCodeInfo_Location* SourceCodeInfo_Location::New(::google::protobuf::Arena* } void SourceCodeInfo_Location::Clear() { - if (_has_bits_[0 / 32] & 12) { + if (_has_bits_[0 / 32] & 12u) { if (has_leading_comments()) { leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -14,6 +14,19 @@ build_cpp_distcheck() { make distcheck -j2 } +build_csharp() { + # Install latest version of Mono + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list + echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list + sudo apt-get update -qq + sudo apt-get install -qq mono-devel referenceassemblies-pcl nunit + wget www.nuget.org/NuGet.exe -O nuget.exe + + (cd csharp/src; mono ../../nuget.exe restore) + csharp/buildall.sh +} + use_java() { if [ `uname` != "Linux" ]; then # It's nontrivial to programmatically install a new JDK from the command @@ -135,6 +148,7 @@ build_jruby() { if [ "$#" -ne 1 ]; then echo " Usage: $0 { cpp | + csharp | java_jdk6 | java_jdk7 | java_oracle7 | |