Commit f015b860 authored by Jon Skeet's avatar Jon Skeet

Remove CLS compliance from runtime code.

We need to remove it from the generator too; I'll raise a github issue for that.
parent 5e0189ab
...@@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt32 from the input /// Returns true if it was able to read a UInt32 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected abstract bool Read(ref uint value); protected abstract bool Read(ref uint value);
/// <summary> /// <summary>
...@@ -74,7 +73,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -74,7 +73,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt64 from the input /// Returns true if it was able to read a UInt64 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected abstract bool Read(ref ulong value); protected abstract bool Read(ref ulong value);
/// <summary> /// <summary>
......
...@@ -62,7 +62,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -62,7 +62,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt32 from the input /// Returns true if it was able to read a UInt32 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override bool Read(ref uint value) protected override bool Read(ref uint value)
{ {
string text = null; string text = null;
...@@ -91,7 +90,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -91,7 +90,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt64 from the input /// Returns true if it was able to read a UInt64 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override bool Read(ref ulong value) protected override bool Read(ref ulong value)
{ {
string text = null; string text = null;
......
...@@ -48,7 +48,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -48,7 +48,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt32 value /// Writes a UInt32 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override void Write(string field, uint value) protected override void Write(string field, uint value)
{ {
WriteAsText(field, XmlConvert.ToString(value), value); WriteAsText(field, XmlConvert.ToString(value), value);
...@@ -65,7 +64,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -65,7 +64,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt64 value /// Writes a UInt64 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override void Write(string field, ulong value) protected override void Write(string field, ulong value)
{ {
WriteAsText(field, XmlConvert.ToString(value), value); WriteAsText(field, XmlConvert.ToString(value), value);
......
...@@ -59,7 +59,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -59,7 +59,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt32 value /// Writes a UInt32 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected abstract void Write(string field, UInt32 value); protected abstract void Write(string field, UInt32 value);
/// <summary> /// <summary>
...@@ -70,7 +69,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -70,7 +69,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt64 value /// Writes a UInt64 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected abstract void Write(string field, UInt64 value); protected abstract void Write(string field, UInt64 value);
/// <summary> /// <summary>
...@@ -185,7 +183,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -185,7 +183,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant /// Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant
/// </summary> /// </summary>
[CLSCompliant(false)]
protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ulong value) protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ulong value)
{ {
} }
...@@ -193,7 +190,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -193,7 +190,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes an unknown field, Expect WireType of GroupStart or LengthPrefix /// Writes an unknown field, Expect WireType of GroupStart or LengthPrefix
/// </summary> /// </summary>
[CLSCompliant(false)]
protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ByteString value) protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ByteString value)
{ {
} }
......
...@@ -118,7 +118,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -118,7 +118,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt32 from the input /// Returns true if it was able to read a UInt32 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override bool Read(ref uint value) protected override bool Read(ref uint value)
{ {
return GetValue(ref value); return GetValue(ref value);
...@@ -135,7 +134,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -135,7 +134,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Returns true if it was able to read a UInt64 from the input /// Returns true if it was able to read a UInt64 from the input
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override bool Read(ref ulong value) protected override bool Read(ref ulong value)
{ {
return GetValue(ref value); return GetValue(ref value);
......
...@@ -85,7 +85,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -85,7 +85,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt32 value /// Writes a UInt32 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override void Write(string field, uint value) protected override void Write(string field, uint value)
{ {
_output[field] = value; _output[field] = value;
...@@ -102,7 +101,6 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -102,7 +101,6 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// Writes a UInt64 value /// Writes a UInt64 value
/// </summary> /// </summary>
[CLSCompliant(false)]
protected override void Write(string field, ulong value) protected override void Write(string field, ulong value)
{ {
_output[field] = value; _output[field] = value;
......
...@@ -63,5 +63,3 @@ using System.Runtime.CompilerServices; ...@@ -63,5 +63,3 @@ using System.Runtime.CompilerServices;
#if !NOFILEVERSION #if !NOFILEVERSION
[assembly: AssemblyFileVersion("2.4.1.555")] [assembly: AssemblyFileVersion("2.4.1.555")]
#endif #endif
[assembly: CLSCompliant(true)]
\ No newline at end of file
...@@ -28,8 +28,3 @@ using System.Runtime.InteropServices; ...@@ -28,8 +28,3 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("2.4.1.555")] // [assembly: AssemblyVersion("2.4.1.555")]
[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
...@@ -71,7 +71,6 @@ namespace Google.ProtocolBuffers ...@@ -71,7 +71,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// uint64 field, including the tag. /// uint64 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeUInt64Size(int fieldNumber, ulong value) public static int ComputeUInt64Size(int fieldNumber, ulong value)
{ {
return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(value); return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(value);
...@@ -107,7 +106,6 @@ namespace Google.ProtocolBuffers ...@@ -107,7 +106,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// fixed64 field, including the tag. /// fixed64 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeFixed64Size(int fieldNumber, ulong value) public static int ComputeFixed64Size(int fieldNumber, ulong value)
{ {
return ComputeTagSize(fieldNumber) + LittleEndian64Size; return ComputeTagSize(fieldNumber) + LittleEndian64Size;
...@@ -117,7 +115,6 @@ namespace Google.ProtocolBuffers ...@@ -117,7 +115,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// fixed32 field, including the tag. /// fixed32 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeFixed32Size(int fieldNumber, uint value) public static int ComputeFixed32Size(int fieldNumber, uint value)
{ {
return ComputeTagSize(fieldNumber) + LittleEndian32Size; return ComputeTagSize(fieldNumber) + LittleEndian32Size;
...@@ -189,7 +186,6 @@ namespace Google.ProtocolBuffers ...@@ -189,7 +186,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// uint32 field, including the tag. /// uint32 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeUInt32Size(int fieldNumber, uint value) public static int ComputeUInt32Size(int fieldNumber, uint value)
{ {
return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(value); return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(value);
...@@ -263,7 +259,6 @@ namespace Google.ProtocolBuffers ...@@ -263,7 +259,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// uint64 field, including the tag. /// uint64 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeUInt64SizeNoTag(ulong value) public static int ComputeUInt64SizeNoTag(ulong value)
{ {
return ComputeRawVarint64Size(value); return ComputeRawVarint64Size(value);
...@@ -299,7 +294,6 @@ namespace Google.ProtocolBuffers ...@@ -299,7 +294,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// fixed64 field, including the tag. /// fixed64 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeFixed64SizeNoTag(ulong value) public static int ComputeFixed64SizeNoTag(ulong value)
{ {
return LittleEndian64Size; return LittleEndian64Size;
...@@ -309,7 +303,6 @@ namespace Google.ProtocolBuffers ...@@ -309,7 +303,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// fixed32 field, including the tag. /// fixed32 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeFixed32SizeNoTag(uint value) public static int ComputeFixed32SizeNoTag(uint value)
{ {
return LittleEndian32Size; return LittleEndian32Size;
...@@ -378,7 +371,6 @@ namespace Google.ProtocolBuffers ...@@ -378,7 +371,6 @@ namespace Google.ProtocolBuffers
/// Compute the number of bytes that would be needed to encode a /// Compute the number of bytes that would be needed to encode a
/// uint32 field, including the tag. /// uint32 field, including the tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeUInt32SizeNoTag(uint value) public static int ComputeUInt32SizeNoTag(uint value)
{ {
return ComputeRawVarint32Size(value); return ComputeRawVarint32Size(value);
...@@ -463,7 +455,6 @@ namespace Google.ProtocolBuffers ...@@ -463,7 +455,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Compute the number of bytes that would be needed to encode a varint. /// Compute the number of bytes that would be needed to encode a varint.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeRawVarint32Size(uint value) public static int ComputeRawVarint32Size(uint value)
{ {
if ((value & (0xffffffff << 7)) == 0) if ((value & (0xffffffff << 7)) == 0)
...@@ -488,7 +479,6 @@ namespace Google.ProtocolBuffers ...@@ -488,7 +479,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Compute the number of bytes that would be needed to encode a varint. /// Compute the number of bytes that would be needed to encode a varint.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int ComputeRawVarint64Size(ulong value) public static int ComputeRawVarint64Size(ulong value)
{ {
if ((value & (0xffffffffffffffffL << 7)) == 0) if ((value & (0xffffffffffffffffL << 7)) == 0)
......
...@@ -159,7 +159,6 @@ namespace Google.ProtocolBuffers ...@@ -159,7 +159,6 @@ namespace Google.ProtocolBuffers
WriteBytes(fieldNumber, null /*not used*/, value); WriteBytes(fieldNumber, null /*not used*/, value);
} }
[CLSCompliant(false)]
public void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value) public void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value)
{ {
if (wireType == WireFormat.WireType.Varint) if (wireType == WireFormat.WireType.Varint)
...@@ -273,7 +272,6 @@ namespace Google.ProtocolBuffers ...@@ -273,7 +272,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a uint64 field value, including tag, to the stream. /// Writes a uint64 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteUInt64(int fieldNumber, string fieldName, ulong value) public void WriteUInt64(int fieldNumber, string fieldName, ulong value)
{ {
WriteTag(fieldNumber, WireFormat.WireType.Varint); WriteTag(fieldNumber, WireFormat.WireType.Varint);
...@@ -309,7 +307,6 @@ namespace Google.ProtocolBuffers ...@@ -309,7 +307,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a fixed64 field value, including tag, to the stream. /// Writes a fixed64 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteFixed64(int fieldNumber, string fieldName, ulong value) public void WriteFixed64(int fieldNumber, string fieldName, ulong value)
{ {
WriteTag(fieldNumber, WireFormat.WireType.Fixed64); WriteTag(fieldNumber, WireFormat.WireType.Fixed64);
...@@ -319,7 +316,6 @@ namespace Google.ProtocolBuffers ...@@ -319,7 +316,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a fixed32 field value, including tag, to the stream. /// Writes a fixed32 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteFixed32(int fieldNumber, string fieldName, uint value) public void WriteFixed32(int fieldNumber, string fieldName, uint value)
{ {
WriteTag(fieldNumber, WireFormat.WireType.Fixed32); WriteTag(fieldNumber, WireFormat.WireType.Fixed32);
...@@ -381,7 +377,6 @@ namespace Google.ProtocolBuffers ...@@ -381,7 +377,6 @@ namespace Google.ProtocolBuffers
value.WriteRawBytesTo(this); value.WriteRawBytesTo(this);
} }
[CLSCompliant(false)]
public void WriteUInt32(int fieldNumber, string fieldName, uint value) public void WriteUInt32(int fieldNumber, string fieldName, uint value)
{ {
WriteTag(fieldNumber, WireFormat.WireType.Varint); WriteTag(fieldNumber, WireFormat.WireType.Varint);
...@@ -541,7 +536,6 @@ namespace Google.ProtocolBuffers ...@@ -541,7 +536,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a uint64 field value, without a tag, to the stream. /// Writes a uint64 field value, without a tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteUInt64NoTag(ulong value) public void WriteUInt64NoTag(ulong value)
{ {
WriteRawVarint64(value); WriteRawVarint64(value);
...@@ -574,7 +568,6 @@ namespace Google.ProtocolBuffers ...@@ -574,7 +568,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a fixed64 field value, without a tag, to the stream. /// Writes a fixed64 field value, without a tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteFixed64NoTag(ulong value) public void WriteFixed64NoTag(ulong value)
{ {
WriteRawLittleEndian64(value); WriteRawLittleEndian64(value);
...@@ -583,7 +576,6 @@ namespace Google.ProtocolBuffers ...@@ -583,7 +576,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a fixed32 field value, without a tag, to the stream. /// Writes a fixed32 field value, without a tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteFixed32NoTag(uint value) public void WriteFixed32NoTag(uint value)
{ {
WriteRawLittleEndian32(value); WriteRawLittleEndian32(value);
...@@ -638,7 +630,6 @@ namespace Google.ProtocolBuffers ...@@ -638,7 +630,6 @@ namespace Google.ProtocolBuffers
value.WriteRawBytesTo(this); value.WriteRawBytesTo(this);
} }
[CLSCompliant(false)]
public void WriteUInt32NoTag(uint value) public void WriteUInt32NoTag(uint value)
{ {
WriteRawVarint32(value); WriteRawVarint32(value);
...@@ -819,7 +810,6 @@ namespace Google.ProtocolBuffers ...@@ -819,7 +810,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list) public void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
where T : struct, IComparable, IFormattable where T : struct, IComparable, IFormattable
{ {
...@@ -1041,7 +1031,6 @@ namespace Google.ProtocolBuffers ...@@ -1041,7 +1031,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list) public void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
where T : struct, IComparable, IFormattable where T : struct, IComparable, IFormattable
{ {
...@@ -1070,7 +1059,6 @@ namespace Google.ProtocolBuffers ...@@ -1070,7 +1059,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Encodes and writes a tag. /// Encodes and writes a tag.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteTag(int fieldNumber, WireFormat.WireType type) public void WriteTag(int fieldNumber, WireFormat.WireType type)
{ {
WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type)); WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type));
...@@ -1081,7 +1069,6 @@ namespace Google.ProtocolBuffers ...@@ -1081,7 +1069,6 @@ namespace Google.ProtocolBuffers
/// there's enough buffer space left to whizz through without checking /// there's enough buffer space left to whizz through without checking
/// for each byte; otherwise, we resort to calling WriteRawByte each time. /// for each byte; otherwise, we resort to calling WriteRawByte each time.
/// </summary> /// </summary>
[CLSCompliant(false)]
public void WriteRawVarint32(uint value) public void WriteRawVarint32(uint value)
{ {
while (value > 127 && position < limit) while (value > 127 && position < limit)
...@@ -1104,7 +1091,6 @@ namespace Google.ProtocolBuffers ...@@ -1104,7 +1091,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public void WriteRawVarint64(ulong value) public void WriteRawVarint64(ulong value)
{ {
while (value > 127 && position < limit) while (value > 127 && position < limit)
...@@ -1127,7 +1113,6 @@ namespace Google.ProtocolBuffers ...@@ -1127,7 +1113,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public void WriteRawLittleEndian32(uint value) public void WriteRawLittleEndian32(uint value)
{ {
if (position + 4 > limit) if (position + 4 > limit)
...@@ -1146,7 +1131,6 @@ namespace Google.ProtocolBuffers ...@@ -1146,7 +1131,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public void WriteRawLittleEndian64(ulong value) public void WriteRawLittleEndian64(ulong value)
{ {
if (position + 8 > limit) if (position + 8 > limit)
...@@ -1183,7 +1167,6 @@ namespace Google.ProtocolBuffers ...@@ -1183,7 +1167,6 @@ namespace Google.ProtocolBuffers
buffer[position++] = value; buffer[position++] = value;
} }
[CLSCompliant(false)]
public void WriteRawByte(uint value) public void WriteRawByte(uint value)
{ {
WriteRawByte((byte) value); WriteRawByte((byte) value);
...@@ -1247,7 +1230,6 @@ namespace Google.ProtocolBuffers ...@@ -1247,7 +1230,6 @@ namespace Google.ProtocolBuffers
/// sign-extended to 64 bits to be varint encoded, thus always taking /// sign-extended to 64 bits to be varint encoded, thus always taking
/// 10 bytes on the wire.) /// 10 bytes on the wire.)
/// </remarks> /// </remarks>
[CLSCompliant(false)]
public static uint EncodeZigZag32(int n) public static uint EncodeZigZag32(int n)
{ {
// Note: the right-shift must be arithmetic // Note: the right-shift must be arithmetic
...@@ -1263,7 +1245,6 @@ namespace Google.ProtocolBuffers ...@@ -1263,7 +1245,6 @@ namespace Google.ProtocolBuffers
/// sign-extended to 64 bits to be varint encoded, thus always taking /// sign-extended to 64 bits to be varint encoded, thus always taking
/// 10 bytes on the wire.) /// 10 bytes on the wire.)
/// </remarks> /// </remarks>
[CLSCompliant(false)]
public static ulong EncodeZigZag64(long n) public static ulong EncodeZigZag64(long n)
{ {
return (ulong) ((n << 1) ^ (n >> 63)); return (ulong) ((n << 1) ^ (n >> 63));
......
...@@ -298,16 +298,6 @@ namespace Google.ProtocolBuffers.Descriptors ...@@ -298,16 +298,6 @@ namespace Google.ProtocolBuffers.Descriptors
get { return fieldType; } get { return fieldType; }
} }
public bool IsCLSCompliant
{
get
{
return mappedType != MappedType.UInt32 &&
mappedType != MappedType.UInt64 &&
!NameHelpers.UnderscoresToPascalCase(Name).StartsWith("_");
}
}
public int FieldNumber public int FieldNumber
{ {
get { return Proto.Number; } get { return Proto.Number; }
......
...@@ -40,7 +40,6 @@ namespace Google.ProtocolBuffers.Descriptors ...@@ -40,7 +40,6 @@ namespace Google.ProtocolBuffers.Descriptors
/// Defined specifically for the <see cref="FieldType" /> enumeration, /// Defined specifically for the <see cref="FieldType" /> enumeration,
/// this allows each field type to specify the mapped type and wire type. /// this allows each field type to specify the mapped type and wire type.
/// </summary> /// </summary>
[CLSCompliant(false)]
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
public sealed class FieldMappingAttribute : Attribute public sealed class FieldMappingAttribute : Attribute
{ {
......
...@@ -129,7 +129,6 @@ namespace Google.ProtocolBuffers ...@@ -129,7 +129,6 @@ namespace Google.ProtocolBuffers
/// Called by subclasses to parse an unknown field or an extension. /// Called by subclasses to parse an unknown field or an extension.
/// </summary> /// </summary>
/// <returns>true unless the tag is an end-group tag</returns> /// <returns>true unless the tag is an end-group tag</returns>
[CLSCompliant(false)]
protected override bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, protected override bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields,
ExtensionRegistry extensionRegistry, uint tag, string fieldName) ExtensionRegistry extensionRegistry, uint tag, string fieldName)
{ {
......
...@@ -132,7 +132,6 @@ namespace Google.ProtocolBuffers ...@@ -132,7 +132,6 @@ namespace Google.ProtocolBuffers
/// Called by subclasses to parse an unknown field or an extension. /// Called by subclasses to parse an unknown field or an extension.
/// </summary> /// </summary>
/// <returns>true unless the tag is an end-group tag</returns> /// <returns>true unless the tag is an end-group tag</returns>
[CLSCompliant(false)]
protected override bool ParseUnknownField(ICodedInputStream input, protected override bool ParseUnknownField(ICodedInputStream input,
ExtensionRegistry extensionRegistry, uint tag, string fieldName) ExtensionRegistry extensionRegistry, uint tag, string fieldName)
{ {
......
...@@ -83,7 +83,6 @@ namespace Google.ProtocolBuffers ...@@ -83,7 +83,6 @@ namespace Google.ProtocolBuffers
/// Called by derived classes to parse an unknown field. /// Called by derived classes to parse an unknown field.
/// </summary> /// </summary>
/// <returns>true unless the tag is an end-group tag</returns> /// <returns>true unless the tag is an end-group tag</returns>
[CLSCompliant(false)]
protected virtual bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, protected virtual bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields,
ExtensionRegistry extensionRegistry, uint tag, string fieldName) ExtensionRegistry extensionRegistry, uint tag, string fieldName)
{ {
......
...@@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers ...@@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers
/// Called by derived classes to parse an unknown field. /// Called by derived classes to parse an unknown field.
/// </summary> /// </summary>
/// <returns>true unless the tag is an end-group tag</returns> /// <returns>true unless the tag is an end-group tag</returns>
[CLSCompliant(false)]
protected virtual bool ParseUnknownField(ICodedInputStream input, protected virtual bool ParseUnknownField(ICodedInputStream input,
ExtensionRegistry extensionRegistry, uint tag, string fieldName) ExtensionRegistry extensionRegistry, uint tag, string fieldName)
{ {
......
...@@ -78,7 +78,6 @@ namespace Google.ProtocolBuffers ...@@ -78,7 +78,6 @@ namespace Google.ProtocolBuffers
/// builders will always prefer the fieldTag over fieldName. /// builders will always prefer the fieldTag over fieldName.
/// </para> /// </para>
/// </remarks> /// </remarks>
[CLSCompliant(false)]
bool ReadTag(out uint fieldTag, out string fieldName); bool ReadTag(out uint fieldTag, out string fieldName);
/// <summary> /// <summary>
...@@ -94,7 +93,6 @@ namespace Google.ProtocolBuffers ...@@ -94,7 +93,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Read a uint64 field from the stream. /// Read a uint64 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
bool ReadUInt64(ref ulong value); bool ReadUInt64(ref ulong value);
/// <summary> /// <summary>
...@@ -110,13 +108,11 @@ namespace Google.ProtocolBuffers ...@@ -110,13 +108,11 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Read a fixed64 field from the stream. /// Read a fixed64 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
bool ReadFixed64(ref ulong value); bool ReadFixed64(ref ulong value);
/// <summary> /// <summary>
/// Read a fixed32 field from the stream. /// Read a fixed32 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
bool ReadFixed32(ref uint value); bool ReadFixed32(ref uint value);
/// <summary> /// <summary>
...@@ -155,7 +151,6 @@ namespace Google.ProtocolBuffers ...@@ -155,7 +151,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Reads a uint32 field value from the stream. /// Reads a uint32 field value from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
bool ReadUInt32(ref uint value); bool ReadUInt32(ref uint value);
/// <summary> /// <summary>
...@@ -169,7 +164,6 @@ namespace Google.ProtocolBuffers ...@@ -169,7 +164,6 @@ namespace Google.ProtocolBuffers
/// then the ref value is set and it returns true. Otherwise the unkown output /// then the ref value is set and it returns true. Otherwise the unkown output
/// value is set and this method returns false. /// value is set and this method returns false.
/// </summary> /// </summary>
[CLSCompliant(false)]
bool ReadEnum<T>(ref T value, out object unknown) bool ReadEnum<T>(ref T value, out object unknown)
where T : struct, IComparable, IFormattable; where T : struct, IComparable, IFormattable;
...@@ -197,14 +191,12 @@ namespace Google.ProtocolBuffers ...@@ -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 /// 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. /// type is numeric, it will read a packed array.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection<object> list); void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection<object> list);
/// <summary> /// <summary>
/// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will
/// read a packed array. /// read a packed array.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadEnumArray(uint fieldTag, string fieldName, ICollection<IEnumLite> list, out ICollection<object> unknown, void ReadEnumArray(uint fieldTag, string fieldName, ICollection<IEnumLite> list, out ICollection<object> unknown,
IEnumLiteMap mapping); IEnumLiteMap mapping);
...@@ -212,7 +204,6 @@ namespace Google.ProtocolBuffers ...@@ -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 /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will
/// read a packed array. /// read a packed array.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list, out ICollection<object> unknown) void ReadEnumArray<T>(uint fieldTag, string fieldName, ICollection<T> list, out ICollection<object> unknown)
where T : struct, IComparable, IFormattable; where T : struct, IComparable, IFormattable;
...@@ -220,14 +211,12 @@ namespace Google.ProtocolBuffers ...@@ -220,14 +211,12 @@ namespace Google.ProtocolBuffers
/// Reads a set of messages using the <paramref name="messageType"/> as a template. T is not guaranteed to be /// Reads a set of messages using the <paramref name="messageType"/> as a template. T is not guaranteed to be
/// the most derived type, it is only the type specifier for the collection. /// the most derived type, it is only the type specifier for the collection.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadMessageArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, void ReadMessageArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType,
ExtensionRegistry registry) where T : IMessageLite; ExtensionRegistry registry) where T : IMessageLite;
/// <summary> /// <summary>
/// Reads a set of messages using the <paramref name="messageType"/> as a template. /// Reads a set of messages using the <paramref name="messageType"/> as a template.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadGroupArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType, void ReadGroupArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType,
ExtensionRegistry registry) where T : IMessageLite; ExtensionRegistry registry) where T : IMessageLite;
...@@ -249,97 +238,81 @@ namespace Google.ProtocolBuffers ...@@ -249,97 +238,81 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
/// <returns>false if the tag is an end-group tag, in which case /// <returns>false if the tag is an end-group tag, in which case
/// nothing is skipped. Otherwise, returns true.</returns> /// nothing is skipped. Otherwise, returns true.</returns>
[CLSCompliant(false)]
bool SkipField(); bool SkipField();
/// <summary> /// <summary>
/// Reads one or more repeated string field values from the stream. /// Reads one or more repeated string field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadStringArray(uint fieldTag, string fieldName, ICollection<string> list); void ReadStringArray(uint fieldTag, string fieldName, ICollection<string> list);
/// <summary> /// <summary>
/// Reads one or more repeated ByteString field values from the stream. /// Reads one or more repeated ByteString field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadBytesArray(uint fieldTag, string fieldName, ICollection<ByteString> list); void ReadBytesArray(uint fieldTag, string fieldName, ICollection<ByteString> list);
/// <summary> /// <summary>
/// Reads one or more repeated boolean field values from the stream. /// Reads one or more repeated boolean field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadBoolArray(uint fieldTag, string fieldName, ICollection<bool> list); void ReadBoolArray(uint fieldTag, string fieldName, ICollection<bool> list);
/// <summary> /// <summary>
/// Reads one or more repeated Int32 field values from the stream. /// Reads one or more repeated Int32 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadInt32Array(uint fieldTag, string fieldName, ICollection<int> list); void ReadInt32Array(uint fieldTag, string fieldName, ICollection<int> list);
/// <summary> /// <summary>
/// Reads one or more repeated SInt32 field values from the stream. /// Reads one or more repeated SInt32 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadSInt32Array(uint fieldTag, string fieldName, ICollection<int> list); void ReadSInt32Array(uint fieldTag, string fieldName, ICollection<int> list);
/// <summary> /// <summary>
/// Reads one or more repeated UInt32 field values from the stream. /// Reads one or more repeated UInt32 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadUInt32Array(uint fieldTag, string fieldName, ICollection<uint> list); void ReadUInt32Array(uint fieldTag, string fieldName, ICollection<uint> list);
/// <summary> /// <summary>
/// Reads one or more repeated Fixed32 field values from the stream. /// Reads one or more repeated Fixed32 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadFixed32Array(uint fieldTag, string fieldName, ICollection<uint> list); void ReadFixed32Array(uint fieldTag, string fieldName, ICollection<uint> list);
/// <summary> /// <summary>
/// Reads one or more repeated SFixed32 field values from the stream. /// Reads one or more repeated SFixed32 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection<int> list); void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection<int> list);
/// <summary> /// <summary>
/// Reads one or more repeated Int64 field values from the stream. /// Reads one or more repeated Int64 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadInt64Array(uint fieldTag, string fieldName, ICollection<long> list); void ReadInt64Array(uint fieldTag, string fieldName, ICollection<long> list);
/// <summary> /// <summary>
/// Reads one or more repeated SInt64 field values from the stream. /// Reads one or more repeated SInt64 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadSInt64Array(uint fieldTag, string fieldName, ICollection<long> list); void ReadSInt64Array(uint fieldTag, string fieldName, ICollection<long> list);
/// <summary> /// <summary>
/// Reads one or more repeated UInt64 field values from the stream. /// Reads one or more repeated UInt64 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadUInt64Array(uint fieldTag, string fieldName, ICollection<ulong> list); void ReadUInt64Array(uint fieldTag, string fieldName, ICollection<ulong> list);
/// <summary> /// <summary>
/// Reads one or more repeated Fixed64 field values from the stream. /// Reads one or more repeated Fixed64 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadFixed64Array(uint fieldTag, string fieldName, ICollection<ulong> list); void ReadFixed64Array(uint fieldTag, string fieldName, ICollection<ulong> list);
/// <summary> /// <summary>
/// Reads one or more repeated SFixed64 field values from the stream. /// Reads one or more repeated SFixed64 field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection<long> list); void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection<long> list);
/// <summary> /// <summary>
/// Reads one or more repeated Double field values from the stream. /// Reads one or more repeated Double field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadDoubleArray(uint fieldTag, string fieldName, ICollection<double> list); void ReadDoubleArray(uint fieldTag, string fieldName, ICollection<double> list);
/// <summary> /// <summary>
/// Reads one or more repeated Float field values from the stream. /// Reads one or more repeated Float field values from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void ReadFloatArray(uint fieldTag, string fieldName, ICollection<float> list); void ReadFloatArray(uint fieldTag, string fieldName, ICollection<float> list);
} }
} }
\ No newline at end of file
...@@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers ...@@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes an unknown field of a primitive type /// Writes an unknown field of a primitive type
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value); void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);
/// <summary> /// <summary>
/// Writes an extension as a message-set group /// Writes an extension as a message-set group
...@@ -114,7 +114,6 @@ namespace Google.ProtocolBuffers ...@@ -114,7 +114,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a uint64 field value, including tag, to the stream. /// Writes a uint64 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteUInt64(int fieldNumber, string fieldName, ulong value); void WriteUInt64(int fieldNumber, string fieldName, ulong value);
/// <summary> /// <summary>
...@@ -130,13 +129,11 @@ namespace Google.ProtocolBuffers ...@@ -130,13 +129,11 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a fixed64 field value, including tag, to the stream. /// Writes a fixed64 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteFixed64(int fieldNumber, string fieldName, ulong value); void WriteFixed64(int fieldNumber, string fieldName, ulong value);
/// <summary> /// <summary>
/// Writes a fixed32 field value, including tag, to the stream. /// Writes a fixed32 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteFixed32(int fieldNumber, string fieldName, uint value); void WriteFixed32(int fieldNumber, string fieldName, uint value);
/// <summary> /// <summary>
...@@ -167,7 +164,6 @@ namespace Google.ProtocolBuffers ...@@ -167,7 +164,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a UInt32 field value, including tag, to the stream. /// Writes a UInt32 field value, including tag, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteUInt32(int fieldNumber, string fieldName, uint value); void WriteUInt32(int fieldNumber, string fieldName, uint value);
/// <summary> /// <summary>
...@@ -290,7 +286,6 @@ namespace Google.ProtocolBuffers ...@@ -290,7 +286,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a repeated enumeration value of type T, including tag(s), to the stream. /// Writes a repeated enumeration value of type T, including tag(s), to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list) void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)
where T : struct, IComparable, IFormattable; where T : struct, IComparable, IFormattable;
...@@ -367,7 +362,6 @@ namespace Google.ProtocolBuffers ...@@ -367,7 +362,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Writes a packed repeated enumeration of type T, including tag and length, to the stream. /// Writes a packed repeated enumeration of type T, including tag and length, to the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list) void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)
where T : struct, IComparable, IFormattable; where T : struct, IComparable, IFormattable;
} }
......
...@@ -65,8 +65,6 @@ using System.Security; ...@@ -65,8 +65,6 @@ using System.Security;
[assembly: AssemblyFileVersion("2.4.1.555")] [assembly: AssemblyFileVersion("2.4.1.555")]
#endif #endif
[assembly: CLSCompliant(true)]
#if CLIENTPROFILE // ROK - not defined in SL, CF, or PL #if CLIENTPROFILE // ROK - not defined in SL, CF, or PL
[assembly: AllowPartiallyTrustedCallers] [assembly: AllowPartiallyTrustedCallers]
#endif #endif
...@@ -300,7 +300,6 @@ namespace Google.ProtocolBuffers ...@@ -300,7 +300,6 @@ namespace Google.ProtocolBuffers
} }
} }
[CLSCompliant(false)]
public static ulong ParseUInt64(string text) public static ulong ParseUInt64(string text)
{ {
return (ulong) ParseInteger(text, false, true); return (ulong) ParseInteger(text, false, true);
...@@ -311,7 +310,6 @@ namespace Google.ProtocolBuffers ...@@ -311,7 +310,6 @@ namespace Google.ProtocolBuffers
return ParseInteger(text, true, true); return ParseInteger(text, true, true);
} }
[CLSCompliant(false)]
public static uint ParseUInt32(string text) public static uint ParseUInt32(string text)
{ {
return (uint) ParseInteger(text, false, false); return (uint) ParseInteger(text, false, false);
......
...@@ -339,7 +339,6 @@ namespace Google.ProtocolBuffers ...@@ -339,7 +339,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Adds a varint value. /// Adds a varint value.
/// </summary> /// </summary>
[CLSCompliant(false)]
public Builder AddVarint(ulong value) public Builder AddVarint(ulong value)
{ {
varintList = Add(varintList, value); varintList = Add(varintList, value);
...@@ -349,7 +348,6 @@ namespace Google.ProtocolBuffers ...@@ -349,7 +348,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Adds a fixed32 value. /// Adds a fixed32 value.
/// </summary> /// </summary>
[CLSCompliant(false)]
public Builder AddFixed32(uint value) public Builder AddFixed32(uint value)
{ {
fixed32List = Add(fixed32List, value); fixed32List = Add(fixed32List, value);
...@@ -359,7 +357,6 @@ namespace Google.ProtocolBuffers ...@@ -359,7 +357,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Adds a fixed64 value. /// Adds a fixed64 value.
/// </summary> /// </summary>
[CLSCompliant(false)]
public Builder AddFixed64(ulong value) public Builder AddFixed64(ulong value)
{ {
fixed64List = Add(fixed64List, value); fixed64List = Add(fixed64List, value);
......
...@@ -446,7 +446,6 @@ namespace Google.ProtocolBuffers ...@@ -446,7 +446,6 @@ namespace Google.ProtocolBuffers
/// <param name="tag">The field's tag number, which was already parsed.</param> /// <param name="tag">The field's tag number, which was already parsed.</param>
/// <param name="input">The coded input stream containing the field</param> /// <param name="input">The coded input stream containing the field</param>
/// <returns>false if the tag is an "end group" tag, true otherwise</returns> /// <returns>false if the tag is an "end group" tag, true otherwise</returns>
[CLSCompliant(false)]
public bool MergeFieldFrom(uint tag, ICodedInputStream input) public bool MergeFieldFrom(uint tag, ICodedInputStream input)
{ {
if (tag == 0) if (tag == 0)
...@@ -554,7 +553,6 @@ namespace Google.ProtocolBuffers ...@@ -554,7 +553,6 @@ namespace Google.ProtocolBuffers
/// value. This is used in particular when an unknown enum value is /// value. This is used in particular when an unknown enum value is
/// encountered. /// encountered.
/// </summary> /// </summary>
[CLSCompliant(false)]
public Builder MergeVarintField(int number, ulong value) public Builder MergeVarintField(int number, ulong value)
{ {
if (number == 0) if (number == 0)
......
...@@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers ...@@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers
#endregion #endregion
[CLSCompliant(false)]
public enum WireType : uint public enum WireType : uint
{ {
Varint = 0, Varint = 0,
...@@ -95,13 +94,11 @@ namespace Google.ProtocolBuffers ...@@ -95,13 +94,11 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Given a tag value, determines the wire type (lower 3 bits). /// Given a tag value, determines the wire type (lower 3 bits).
/// </summary> /// </summary>
[CLSCompliant(false)]
public static WireType GetTagWireType(uint tag) public static WireType GetTagWireType(uint tag)
{ {
return (WireType) (tag & TagTypeMask); return (WireType) (tag & TagTypeMask);
} }
[CLSCompliant(false)]
public static bool IsEndGroupTag(uint tag) public static bool IsEndGroupTag(uint tag)
{ {
return (WireType) (tag & TagTypeMask) == WireType.EndGroup; return (WireType) (tag & TagTypeMask) == WireType.EndGroup;
...@@ -110,7 +107,6 @@ namespace Google.ProtocolBuffers ...@@ -110,7 +107,6 @@ namespace Google.ProtocolBuffers
/// <summary> /// <summary>
/// Given a tag value, determines the field number (the upper 29 bits). /// Given a tag value, determines the field number (the upper 29 bits).
/// </summary> /// </summary>
[CLSCompliant(false)]
public static int GetTagFieldNumber(uint tag) public static int GetTagFieldNumber(uint tag)
{ {
return (int) tag >> TagTypeBits; return (int) tag >> TagTypeBits;
...@@ -120,14 +116,12 @@ namespace Google.ProtocolBuffers ...@@ -120,14 +116,12 @@ namespace Google.ProtocolBuffers
/// Makes a tag value given a field number and wire type. /// Makes a tag value given a field number and wire type.
/// TODO(jonskeet): Should we just have a Tag structure? /// TODO(jonskeet): Should we just have a Tag structure?
/// </summary> /// </summary>
[CLSCompliant(false)]
public static uint MakeTag(int fieldNumber, WireType wireType) public static uint MakeTag(int fieldNumber, WireType wireType)
{ {
return (uint) (fieldNumber << TagTypeBits) | (uint) wireType; return (uint) (fieldNumber << TagTypeBits) | (uint) wireType;
} }
#if !LITE #if !LITE
[CLSCompliant(false)]
public static uint MakeTag(FieldDescriptor field) public static uint MakeTag(FieldDescriptor field)
{ {
return MakeTag(field.FieldNumber, GetWireType(field)); return MakeTag(field.FieldNumber, GetWireType(field));
...@@ -148,7 +142,6 @@ namespace Google.ProtocolBuffers ...@@ -148,7 +142,6 @@ namespace Google.ProtocolBuffers
/// Converts a field type to its wire type. Done with a switch for the sake /// 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. /// of speed - this is significantly faster than a dictionary lookup.
/// </summary> /// </summary>
[CLSCompliant(false)]
public static WireType GetWireType(FieldType fieldType) public static WireType GetWireType(FieldType fieldType)
{ {
switch (fieldType) switch (fieldType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment