From f651f73a3c3356a93c4e3c131833ed8b5d93e2bc Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 09:18:19 +0100 Subject: Remove support for Serializable. This could potentially be added back in later, but its use is limited and it's a pain in terms of support in PCL environments. One use that has been highlighted is passing objects between AppDomains; we'd recommend passing a byte array explicitly and reparsing on the other side. --- .../ProtocolBuffers.Test.csproj | 2 - .../ProtocolBuffers.Test/SerializableAttribute.cs | 12 -- .../src/ProtocolBuffers.Test/SerializableTest.cs | 184 --------------------- 3 files changed, 198 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/SerializableTest.cs (limited to 'csharp/src/ProtocolBuffers.Test') diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index b11b1ad8..5702c011 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -81,7 +81,6 @@ - @@ -112,7 +111,6 @@ - diff --git a/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs b/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs deleted file mode 100644 index 0553762b..00000000 --- a/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if NOSERIALIZABLE && !COMPACT_FRAMEWORK - -namespace System -{ - [AttributeUsage(AttributeTargets.Class)] - public class SerializableAttribute : Attribute - { - public SerializableAttribute () : base() { } - } -} - -#endif diff --git a/csharp/src/ProtocolBuffers.Test/SerializableTest.cs b/csharp/src/ProtocolBuffers.Test/SerializableTest.cs deleted file mode 100644 index da5b0b51..00000000 --- a/csharp/src/ProtocolBuffers.Test/SerializableTest.cs +++ /dev/null @@ -1,184 +0,0 @@ -#if !NOSERIALIZABLE -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Hosting; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class SerializableTest - { - /// - /// Just keep it from even compiling if we these objects don't implement the expected interface. - /// - public static readonly ISerializable CompileTimeCheckSerializableMessage = TestXmlMessage.DefaultInstance; - public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestXmlMessage.Builder(); - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - TestXmlMessage copy = (TestXmlMessage)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(message, copy); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestMessageWithExtensions() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnittestExtrasXmltest.ExtensionText, " extension text value ! ") - .SetExtension(UnittestExtrasXmltest.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 100) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 101) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 102) - .SetExtension(UnittestExtrasXmltest.ExtensionEnum, EnumOptions.ONE) - .Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnittestExtrasXmltest.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage copy = (TestXmlMessage)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(message, copy); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainBuilder() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - ; - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(builder.Build(), copy.Build()); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestBuilderWithExtensions() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnittestExtrasXmltest.ExtensionText, " extension text value ! ") - .SetExtension(UnittestExtrasXmltest.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 100) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 101) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 102) - .SetExtension(UnittestExtrasXmltest.ExtensionEnum, EnumOptions.ONE) - ; - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnittestExtrasXmltest.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(builder.Build(), copy.Build()); - } - } -} -#endif \ No newline at end of file -- cgit v1.2.3 From f015b860b74f1f7a5dc1a9fbf8b30daf7539d669 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 12:20:12 +0100 Subject: Remove CLS compliance from runtime code. We need to remove it from the generator too; I'll raise a github issue for that. --- .../AbstractReader.cs | 2 -- .../AbstractTextReader.cs | 2 -- .../AbstractTextWriter.cs | 2 -- .../AbstractWriter.cs | 4 --- .../DictionaryReader.cs | 2 -- .../DictionaryWriter.cs | 2 -- .../Properties/AssemblyInfo.cs | 2 -- .../Properties/AssemblyInfo.cs | 5 --- csharp/src/ProtocolBuffers/CodedInputStream.cs | 36 ---------------------- .../CodedOutputStream.ComputeSize.cs | 10 ------ csharp/src/ProtocolBuffers/CodedOutputStream.cs | 19 ------------ .../ProtocolBuffers/Descriptors/FieldDescriptor.cs | 10 ------ .../Descriptors/FieldMappingAttribute.cs | 1 - csharp/src/ProtocolBuffers/ExtendableBuilder.cs | 1 - .../src/ProtocolBuffers/ExtendableBuilderLite.cs | 1 - csharp/src/ProtocolBuffers/GeneratedBuilder.cs | 1 - csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs | 1 - csharp/src/ProtocolBuffers/ICodedInputStream.cs | 27 ---------------- csharp/src/ProtocolBuffers/ICodedOutputStream.cs | 8 +---- .../src/ProtocolBuffers/Properties/AssemblyInfo.cs | 2 -- csharp/src/ProtocolBuffers/TextFormat.cs | 2 -- csharp/src/ProtocolBuffers/UnknownField.cs | 3 -- csharp/src/ProtocolBuffers/UnknownFieldSet.cs | 2 -- csharp/src/ProtocolBuffers/WireFormat.cs | 7 ----- 24 files changed, 1 insertion(+), 151 deletions(-) (limited to 'csharp/src/ProtocolBuffers.Test') diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs index e198d0b0..99ecec88 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs @@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected abstract bool Read(ref uint value); /// @@ -74,7 +73,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected abstract bool Read(ref ulong value); /// diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs index b40a560a..41578fab 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs @@ -62,7 +62,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected override bool Read(ref uint value) { string text = null; @@ -91,7 +90,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected override bool Read(ref ulong value) { string text = null; diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs index 2c778dfc..e13cbbab 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs @@ -48,7 +48,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected override void Write(string field, uint value) { WriteAsText(field, XmlConvert.ToString(value), value); @@ -65,7 +64,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected override void Write(string field, ulong value) { WriteAsText(field, XmlConvert.ToString(value), value); diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs index 2dc6b887..f4cfe3e1 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs @@ -59,7 +59,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected abstract void Write(string field, UInt32 value); /// @@ -70,7 +69,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected abstract void Write(string field, UInt64 value); /// @@ -185,7 +183,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant /// - [CLSCompliant(false)] protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ulong value) { } @@ -193,7 +190,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes an unknown field, Expect WireType of GroupStart or LengthPrefix /// - [CLSCompliant(false)] protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ByteString value) { } diff --git a/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs b/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs index c460523c..971d0fee 100644 --- a/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs @@ -118,7 +118,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected override bool Read(ref uint value) { return GetValue(ref value); @@ -135,7 +134,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected override bool Read(ref ulong value) { return GetValue(ref value); diff --git a/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs b/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs index 6d823301..8cc8ed6b 100644 --- a/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs @@ -85,7 +85,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected override void Write(string field, uint value) { _output[field] = value; @@ -102,7 +101,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected override void Write(string field, ulong value) { _output[field] = value; diff --git a/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs index c6420b56..0ab58120 100644 --- a/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs @@ -63,5 +63,3 @@ using System.Runtime.CompilerServices; #if !NOFILEVERSION [assembly: AssemblyFileVersion("2.4.1.555")] #endif - -[assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs index b443ea3a..bfa1f05e 100644 --- a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs @@ -28,8 +28,3 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("2.4.1.555")] [assembly: AssemblyVersion("2.4.1.555")] - -// We don't really need CLSCompliance, but if the assembly builds with no warnings, -// that means the generator is okay. - -[assembly: CLSCompliant(false)] \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/CodedInputStream.cs b/csharp/src/ProtocolBuffers/CodedInputStream.cs index 773e8c18..37774d01 100644 --- a/csharp/src/ProtocolBuffers/CodedInputStream.cs +++ b/csharp/src/ProtocolBuffers/CodedInputStream.cs @@ -186,7 +186,6 @@ namespace Google.ProtocolBuffers /// /// The last /// tag read was not the one specified - [CLSCompliant(false)] public void CheckLastTagWas(uint value) { if (lastTag != value) @@ -202,7 +201,6 @@ namespace Google.ProtocolBuffers /// /// Attempt to peek at the next field tag. /// - [CLSCompliant(false)] public bool PeekNextTag(out uint fieldTag, out string fieldName) { if (hasNextTag) @@ -226,7 +224,6 @@ namespace Google.ProtocolBuffers /// The 'tag' of the field (id * 8 + wire-format) /// Not Supported - For protobuffer streams, this parameter is always null /// true if the next fieldTag was read - [CLSCompliant(false)] public bool ReadTag(out uint fieldTag, out string fieldName) { fieldName = null; @@ -290,7 +287,6 @@ namespace Google.ProtocolBuffers /// /// Read a uint64 field from the stream. /// - [CLSCompliant(false)] public bool ReadUInt64(ref ulong value) { value = ReadRawVarint64(); @@ -318,7 +314,6 @@ namespace Google.ProtocolBuffers /// /// Read a fixed64 field from the stream. /// - [CLSCompliant(false)] public bool ReadFixed64(ref ulong value) { value = ReadRawLittleEndian64(); @@ -328,7 +323,6 @@ namespace Google.ProtocolBuffers /// /// Read a fixed32 field from the stream. /// - [CLSCompliant(false)] public bool ReadFixed32(ref uint value) { value = ReadRawLittleEndian32(); @@ -447,7 +441,6 @@ namespace Google.ProtocolBuffers /// /// Reads a uint32 field value from the stream. /// - [CLSCompliant(false)] public bool ReadUInt32(ref uint value) { value = ReadRawVarint32(); @@ -477,7 +470,6 @@ namespace Google.ProtocolBuffers /// then the ref value is set and it returns true. Otherwise the unknown output /// value is set and this method returns false. /// - [CLSCompliant(false)] public bool ReadEnum(ref T value, out object unknown) where T : struct, IComparable, IFormattable { @@ -593,7 +585,6 @@ namespace Google.ProtocolBuffers return false; } - [CLSCompliant(false)] public void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list) { WireFormat.WireType normal = WireFormat.GetWireType(fieldType); @@ -627,7 +618,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadStringArray(uint fieldTag, string fieldName, ICollection list) { string tmp = null; @@ -638,7 +628,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadBytesArray(uint fieldTag, string fieldName, ICollection list) { ByteString tmp = null; @@ -649,7 +638,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadBoolArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -665,7 +653,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -681,7 +668,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -697,7 +683,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -713,7 +698,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -729,7 +713,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -745,7 +728,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -761,7 +743,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -777,7 +758,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -793,7 +773,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -809,7 +788,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -825,7 +803,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -841,7 +818,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFloatArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -857,7 +833,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown, IEnumLiteMap mapping) { @@ -908,7 +883,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown) where T : struct, IComparable, IFormattable @@ -960,7 +934,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite { @@ -972,7 +945,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite { @@ -1217,7 +1189,6 @@ namespace Google.ProtocolBuffers /// That means we can check the size just once, then just read directly from the buffer /// without constant rechecking of the buffer length. /// - [CLSCompliant(false)] public uint ReadRawVarint32() { if (bufferPos + 5 > bufferSize) @@ -1283,7 +1254,6 @@ namespace Google.ProtocolBuffers /// /// /// - [CLSCompliant(false)] public static uint ReadRawVarint32(Stream input) { int result = 0; @@ -1320,7 +1290,6 @@ namespace Google.ProtocolBuffers /// /// Read a raw varint from the stream. /// - [CLSCompliant(false)] public ulong ReadRawVarint64() { int shift = 0; @@ -1341,7 +1310,6 @@ namespace Google.ProtocolBuffers /// /// Read a 32-bit little-endian integer from the stream. /// - [CLSCompliant(false)] public uint ReadRawLittleEndian32() { uint b1 = ReadRawByte(); @@ -1354,7 +1322,6 @@ namespace Google.ProtocolBuffers /// /// Read a 64-bit little-endian integer from the stream. /// - [CLSCompliant(false)] public ulong ReadRawLittleEndian64() { ulong b1 = ReadRawByte(); @@ -1380,7 +1347,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static int DecodeZigZag32(uint n) { return (int) (n >> 1) ^ -(int) (n & 1); @@ -1395,7 +1361,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static long DecodeZigZag64(ulong n) { return (long) (n >> 1) ^ -(long) (n & 1); @@ -1732,7 +1697,6 @@ namespace Google.ProtocolBuffers /// /// false if the tag is an end-group tag, in which case /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] public bool SkipField() { uint tag = lastTag; diff --git a/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs b/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs index ca6662a4..99d82fce 100644 --- a/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs +++ b/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs @@ -71,7 +71,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt64Size(int fieldNumber, ulong value) { return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(value); @@ -107,7 +106,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed64Size(int fieldNumber, ulong value) { return ComputeTagSize(fieldNumber) + LittleEndian64Size; @@ -117,7 +115,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed32Size(int fieldNumber, uint value) { return ComputeTagSize(fieldNumber) + LittleEndian32Size; @@ -189,7 +186,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt32Size(int fieldNumber, uint value) { return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(value); @@ -263,7 +259,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt64SizeNoTag(ulong value) { return ComputeRawVarint64Size(value); @@ -299,7 +294,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed64SizeNoTag(ulong value) { return LittleEndian64Size; @@ -309,7 +303,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed32SizeNoTag(uint value) { return LittleEndian32Size; @@ -378,7 +371,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt32SizeNoTag(uint value) { return ComputeRawVarint32Size(value); @@ -463,7 +455,6 @@ namespace Google.ProtocolBuffers /// /// Compute the number of bytes that would be needed to encode a varint. /// - [CLSCompliant(false)] public static int ComputeRawVarint32Size(uint value) { if ((value & (0xffffffff << 7)) == 0) @@ -488,7 +479,6 @@ namespace Google.ProtocolBuffers /// /// Compute the number of bytes that would be needed to encode a varint. /// - [CLSCompliant(false)] public static int ComputeRawVarint64Size(ulong value) { if ((value & (0xffffffffffffffffL << 7)) == 0) diff --git a/csharp/src/ProtocolBuffers/CodedOutputStream.cs b/csharp/src/ProtocolBuffers/CodedOutputStream.cs index d267b75e..c37fcc18 100644 --- a/csharp/src/ProtocolBuffers/CodedOutputStream.cs +++ b/csharp/src/ProtocolBuffers/CodedOutputStream.cs @@ -159,7 +159,6 @@ namespace Google.ProtocolBuffers WriteBytes(fieldNumber, null /*not used*/, value); } - [CLSCompliant(false)] public void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value) { if (wireType == WireFormat.WireType.Varint) @@ -273,7 +272,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteUInt64(int fieldNumber, string fieldName, ulong value) { WriteTag(fieldNumber, WireFormat.WireType.Varint); @@ -309,7 +307,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed64(int fieldNumber, string fieldName, ulong value) { WriteTag(fieldNumber, WireFormat.WireType.Fixed64); @@ -319,7 +316,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed32 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed32(int fieldNumber, string fieldName, uint value) { WriteTag(fieldNumber, WireFormat.WireType.Fixed32); @@ -381,7 +377,6 @@ namespace Google.ProtocolBuffers value.WriteRawBytesTo(this); } - [CLSCompliant(false)] public void WriteUInt32(int fieldNumber, string fieldName, uint value) { WriteTag(fieldNumber, WireFormat.WireType.Varint); @@ -541,7 +536,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteUInt64NoTag(ulong value) { WriteRawVarint64(value); @@ -574,7 +568,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed64NoTag(ulong value) { WriteRawLittleEndian64(value); @@ -583,7 +576,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed32 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed32NoTag(uint value) { WriteRawLittleEndian32(value); @@ -638,7 +630,6 @@ namespace Google.ProtocolBuffers value.WriteRawBytesTo(this); } - [CLSCompliant(false)] public void WriteUInt32NoTag(uint value) { WriteRawVarint32(value); @@ -819,7 +810,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) where T : struct, IComparable, IFormattable { @@ -1041,7 +1031,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) where T : struct, IComparable, IFormattable { @@ -1070,7 +1059,6 @@ namespace Google.ProtocolBuffers /// /// Encodes and writes a tag. /// - [CLSCompliant(false)] public void WriteTag(int fieldNumber, WireFormat.WireType type) { WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type)); @@ -1081,7 +1069,6 @@ namespace Google.ProtocolBuffers /// there's enough buffer space left to whizz through without checking /// for each byte; otherwise, we resort to calling WriteRawByte each time. /// - [CLSCompliant(false)] public void WriteRawVarint32(uint value) { while (value > 127 && position < limit) @@ -1104,7 +1091,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawVarint64(ulong value) { while (value > 127 && position < limit) @@ -1127,7 +1113,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawLittleEndian32(uint value) { if (position + 4 > limit) @@ -1146,7 +1131,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawLittleEndian64(ulong value) { if (position + 8 > limit) @@ -1183,7 +1167,6 @@ namespace Google.ProtocolBuffers buffer[position++] = value; } - [CLSCompliant(false)] public void WriteRawByte(uint value) { WriteRawByte((byte) value); @@ -1247,7 +1230,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static uint EncodeZigZag32(int n) { // Note: the right-shift must be arithmetic @@ -1263,7 +1245,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static ulong EncodeZigZag64(long n) { return (ulong) ((n << 1) ^ (n >> 63)); diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 98de5435..076dc852 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -298,16 +298,6 @@ namespace Google.ProtocolBuffers.Descriptors get { return fieldType; } } - public bool IsCLSCompliant - { - get - { - return mappedType != MappedType.UInt32 && - mappedType != MappedType.UInt64 && - !NameHelpers.UnderscoresToPascalCase(Name).StartsWith("_"); - } - } - public int FieldNumber { get { return Proto.Number; } diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs index fc58d046..752ecf66 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs @@ -40,7 +40,6 @@ namespace Google.ProtocolBuffers.Descriptors /// Defined specifically for the enumeration, /// this allows each field type to specify the mapped type and wire type. /// - [CLSCompliant(false)] [AttributeUsage(AttributeTargets.Field)] public sealed class FieldMappingAttribute : Attribute { diff --git a/csharp/src/ProtocolBuffers/ExtendableBuilder.cs b/csharp/src/ProtocolBuffers/ExtendableBuilder.cs index 111ff57e..62508e02 100644 --- a/csharp/src/ProtocolBuffers/ExtendableBuilder.cs +++ b/csharp/src/ProtocolBuffers/ExtendableBuilder.cs @@ -129,7 +129,6 @@ namespace Google.ProtocolBuffers /// Called by subclasses to parse an unknown field or an extension. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected override bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs b/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs index 2a71aa4a..7f97ccfb 100644 --- a/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs +++ b/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs @@ -132,7 +132,6 @@ namespace Google.ProtocolBuffers /// Called by subclasses to parse an unknown field or an extension. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected override bool ParseUnknownField(ICodedInputStream input, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs index fd6fe4d7..e60a4201 100644 --- a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs +++ b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs @@ -83,7 +83,6 @@ namespace Google.ProtocolBuffers /// Called by derived classes to parse an unknown field. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected virtual bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs b/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs index 4030e801..5783c987 100644 --- a/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs +++ b/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs @@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers /// Called by derived classes to parse an unknown field. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected virtual bool ParseUnknownField(ICodedInputStream input, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/ICodedInputStream.cs b/csharp/src/ProtocolBuffers/ICodedInputStream.cs index b39b602d..790274fb 100644 --- a/csharp/src/ProtocolBuffers/ICodedInputStream.cs +++ b/csharp/src/ProtocolBuffers/ICodedInputStream.cs @@ -78,7 +78,6 @@ namespace Google.ProtocolBuffers /// builders will always prefer the fieldTag over fieldName. /// /// - [CLSCompliant(false)] bool ReadTag(out uint fieldTag, out string fieldName); /// @@ -94,7 +93,6 @@ namespace Google.ProtocolBuffers /// /// Read a uint64 field from the stream. /// - [CLSCompliant(false)] bool ReadUInt64(ref ulong value); /// @@ -110,13 +108,11 @@ namespace Google.ProtocolBuffers /// /// Read a fixed64 field from the stream. /// - [CLSCompliant(false)] bool ReadFixed64(ref ulong value); /// /// Read a fixed32 field from the stream. /// - [CLSCompliant(false)] bool ReadFixed32(ref uint value); /// @@ -155,7 +151,6 @@ namespace Google.ProtocolBuffers /// /// Reads a uint32 field value from the stream. /// - [CLSCompliant(false)] bool ReadUInt32(ref uint value); /// @@ -169,7 +164,6 @@ namespace Google.ProtocolBuffers /// then the ref value is set and it returns true. Otherwise the unkown output /// value is set and this method returns false. /// - [CLSCompliant(false)] bool ReadEnum(ref T value, out object unknown) where T : struct, IComparable, IFormattable; @@ -197,14 +191,12 @@ namespace Google.ProtocolBuffers /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed and the /// type is numeric, it will read a packed array. /// - [CLSCompliant(false)] void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list); /// /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will /// read a packed array. /// - [CLSCompliant(false)] void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown, IEnumLiteMap mapping); @@ -212,7 +204,6 @@ namespace Google.ProtocolBuffers /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will /// read a packed array. /// - [CLSCompliant(false)] void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown) where T : struct, IComparable, IFormattable; @@ -220,14 +211,12 @@ namespace Google.ProtocolBuffers /// Reads a set of messages using the as a template. T is not guaranteed to be /// the most derived type, it is only the type specifier for the collection. /// - [CLSCompliant(false)] void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite; /// /// Reads a set of messages using the as a template. /// - [CLSCompliant(false)] void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite; @@ -249,97 +238,81 @@ namespace Google.ProtocolBuffers /// /// false if the tag is an end-group tag, in which case /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] bool SkipField(); /// /// Reads one or more repeated string field values from the stream. /// - [CLSCompliant(false)] void ReadStringArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated ByteString field values from the stream. /// - [CLSCompliant(false)] void ReadBytesArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated boolean field values from the stream. /// - [CLSCompliant(false)] void ReadBoolArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Int32 field values from the stream. /// - [CLSCompliant(false)] void ReadInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SInt32 field values from the stream. /// - [CLSCompliant(false)] void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated UInt32 field values from the stream. /// - [CLSCompliant(false)] void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Fixed32 field values from the stream. /// - [CLSCompliant(false)] void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SFixed32 field values from the stream. /// - [CLSCompliant(false)] void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Int64 field values from the stream. /// - [CLSCompliant(false)] void ReadInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SInt64 field values from the stream. /// - [CLSCompliant(false)] void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated UInt64 field values from the stream. /// - [CLSCompliant(false)] void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Fixed64 field values from the stream. /// - [CLSCompliant(false)] void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SFixed64 field values from the stream. /// - [CLSCompliant(false)] void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Double field values from the stream. /// - [CLSCompliant(false)] void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Float field values from the stream. /// - [CLSCompliant(false)] void ReadFloatArray(uint fieldTag, string fieldName, ICollection list); } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs index 64c80653..77de60ca 100644 --- a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs +++ b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs @@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers /// /// Writes an unknown field of a primitive type /// - [CLSCompliant(false)] + void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value); /// /// Writes an extension as a message-set group @@ -114,7 +114,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteUInt64(int fieldNumber, string fieldName, ulong value); /// @@ -130,13 +129,11 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteFixed64(int fieldNumber, string fieldName, ulong value); /// /// Writes a fixed32 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteFixed32(int fieldNumber, string fieldName, uint value); /// @@ -167,7 +164,6 @@ namespace Google.ProtocolBuffers /// /// Writes a UInt32 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteUInt32(int fieldNumber, string fieldName, uint value); /// @@ -290,7 +286,6 @@ namespace Google.ProtocolBuffers /// /// Writes a repeated enumeration value of type T, including tag(s), to the stream. /// - [CLSCompliant(false)] void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) where T : struct, IComparable, IFormattable; @@ -367,7 +362,6 @@ namespace Google.ProtocolBuffers /// /// Writes a packed repeated enumeration of type T, including tag and length, to the stream. /// - [CLSCompliant(false)] void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) where T : struct, IComparable, IFormattable; } diff --git a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs index cbab444d..063f6666 100644 --- a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs @@ -65,8 +65,6 @@ using System.Security; [assembly: AssemblyFileVersion("2.4.1.555")] #endif -[assembly: CLSCompliant(true)] - #if CLIENTPROFILE // ROK - not defined in SL, CF, or PL [assembly: AllowPartiallyTrustedCallers] #endif diff --git a/csharp/src/ProtocolBuffers/TextFormat.cs b/csharp/src/ProtocolBuffers/TextFormat.cs index 747dce4e..951cdc0e 100644 --- a/csharp/src/ProtocolBuffers/TextFormat.cs +++ b/csharp/src/ProtocolBuffers/TextFormat.cs @@ -300,7 +300,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public static ulong ParseUInt64(string text) { return (ulong) ParseInteger(text, false, true); @@ -311,7 +310,6 @@ namespace Google.ProtocolBuffers return ParseInteger(text, true, true); } - [CLSCompliant(false)] public static uint ParseUInt32(string text) { return (uint) ParseInteger(text, false, false); diff --git a/csharp/src/ProtocolBuffers/UnknownField.cs b/csharp/src/ProtocolBuffers/UnknownField.cs index e03477fe..7650b9df 100644 --- a/csharp/src/ProtocolBuffers/UnknownField.cs +++ b/csharp/src/ProtocolBuffers/UnknownField.cs @@ -339,7 +339,6 @@ namespace Google.ProtocolBuffers /// /// Adds a varint value. /// - [CLSCompliant(false)] public Builder AddVarint(ulong value) { varintList = Add(varintList, value); @@ -349,7 +348,6 @@ namespace Google.ProtocolBuffers /// /// Adds a fixed32 value. /// - [CLSCompliant(false)] public Builder AddFixed32(uint value) { fixed32List = Add(fixed32List, value); @@ -359,7 +357,6 @@ namespace Google.ProtocolBuffers /// /// Adds a fixed64 value. /// - [CLSCompliant(false)] public Builder AddFixed64(ulong value) { fixed64List = Add(fixed64List, value); diff --git a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs index 09ed680f..aee1b7c9 100644 --- a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs +++ b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs @@ -446,7 +446,6 @@ namespace Google.ProtocolBuffers /// The field's tag number, which was already parsed. /// The coded input stream containing the field /// false if the tag is an "end group" tag, true otherwise - [CLSCompliant(false)] public bool MergeFieldFrom(uint tag, ICodedInputStream input) { if (tag == 0) @@ -554,7 +553,6 @@ namespace Google.ProtocolBuffers /// value. This is used in particular when an unknown enum value is /// encountered. /// - [CLSCompliant(false)] public Builder MergeVarintField(int number, ulong value) { if (number == 0) diff --git a/csharp/src/ProtocolBuffers/WireFormat.cs b/csharp/src/ProtocolBuffers/WireFormat.cs index a03f1652..b9daa328 100644 --- a/csharp/src/ProtocolBuffers/WireFormat.cs +++ b/csharp/src/ProtocolBuffers/WireFormat.cs @@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers #endregion - [CLSCompliant(false)] public enum WireType : uint { Varint = 0, @@ -95,13 +94,11 @@ namespace Google.ProtocolBuffers /// /// Given a tag value, determines the wire type (lower 3 bits). /// - [CLSCompliant(false)] public static WireType GetTagWireType(uint tag) { return (WireType) (tag & TagTypeMask); } - [CLSCompliant(false)] public static bool IsEndGroupTag(uint tag) { return (WireType) (tag & TagTypeMask) == WireType.EndGroup; @@ -110,7 +107,6 @@ namespace Google.ProtocolBuffers /// /// Given a tag value, determines the field number (the upper 29 bits). /// - [CLSCompliant(false)] public static int GetTagFieldNumber(uint tag) { return (int) tag >> TagTypeBits; @@ -120,14 +116,12 @@ namespace Google.ProtocolBuffers /// Makes a tag value given a field number and wire type. /// TODO(jonskeet): Should we just have a Tag structure? /// - [CLSCompliant(false)] public static uint MakeTag(int fieldNumber, WireType wireType) { return (uint) (fieldNumber << TagTypeBits) | (uint) wireType; } #if !LITE - [CLSCompliant(false)] public static uint MakeTag(FieldDescriptor field) { return MakeTag(field.FieldNumber, GetWireType(field)); @@ -148,7 +142,6 @@ namespace Google.ProtocolBuffers /// Converts a field type to its wire type. Done with a switch for the sake /// of speed - this is significantly faster than a dictionary lookup. /// - [CLSCompliant(false)] public static WireType GetWireType(FieldType fieldType) { switch (fieldType) -- cgit v1.2.3