Commit d6dd0a45 authored by Jon Skeet's avatar Jon Skeet

Add CLSCompliance.

parent 0864d30b
...@@ -15,6 +15,7 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -15,6 +15,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public bool Has{0} {{", PropertyName); writer.WriteLine("public bool Has{0} {{", PropertyName);
writer.WriteLine(" get {{ return has{0}; }}", PropertyName); writer.WriteLine(" get {{ return has{0}; }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); writer.WriteLine("public {0} {1} {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return {0}_; }}", Name); writer.WriteLine(" get {{ return {0}_; }}", Name);
writer.WriteLine("}"); writer.WriteLine("}");
...@@ -24,10 +25,12 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -24,10 +25,12 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public bool Has{0} {{", PropertyName); writer.WriteLine("public bool Has{0} {{", PropertyName);
writer.WriteLine(" get {{ return result.Has{0}; }}", PropertyName); writer.WriteLine(" get {{ return result.Has{0}; }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); writer.WriteLine("public {0} {1} {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); writer.WriteLine(" get {{ return result.{0}; }}", PropertyName);
writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName);
writer.WriteLine(" result.has{0} = true;", PropertyName); writer.WriteLine(" result.has{0} = true;", PropertyName);
writer.WriteLine(" result.{0}_ = value;", Name); writer.WriteLine(" result.{0}_ = value;", Name);
......
...@@ -30,8 +30,14 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -30,8 +30,14 @@ namespace Google.ProtocolBuffers.ProtoGen {
public void Generate(TextGenerator writer) { public void Generate(TextGenerator writer) {
writer.WriteLine ("public const int {0} = {1};", GetFieldConstantName(Descriptor), Descriptor.FieldNumber); writer.WriteLine ("public const int {0} = {1};", GetFieldConstantName(Descriptor), Descriptor.FieldNumber);
if (Descriptor.IsRepeated) { if (Descriptor.IsRepeated) {
if (!Descriptor.IsCLSCompliant) {
writer.WriteLine("[global::System.CLSCompliant(false)]");
}
writer.WriteLine("{0} static pb::GeneratedExtensionBase<scg::IList<{1}>> {2};", ClassAccessLevel, type, name); writer.WriteLine("{0} static pb::GeneratedExtensionBase<scg::IList<{1}>> {2};", ClassAccessLevel, type, name);
} else { } else {
if (!Descriptor.IsCLSCompliant) {
writer.WriteLine("[global::System.CLSCompliant(false)]");
}
writer.WriteLine("{0} static pb::GeneratedExtensionBase<{1}> {2};", ClassAccessLevel, type, name); writer.WriteLine("{0} static pb::GeneratedExtensionBase<{1}> {2};", ClassAccessLevel, type, name);
} }
} }
......
...@@ -97,6 +97,12 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -97,6 +97,12 @@ namespace Google.ProtocolBuffers.ProtoGen {
} }
} }
protected void AddClsComplianceCheck(TextGenerator writer) {
if (!Descriptor.IsCLSCompliant) {
writer.WriteLine("[global::System.CLSCompliant(false)]");
}
}
/// <summary> /// <summary>
/// For encodings with fixed sizes, returns that size in bytes. Otherwise /// For encodings with fixed sizes, returns that size in bytes. Otherwise
/// returns -1. TODO(jonskeet): Make this less ugly. /// returns -1. TODO(jonskeet): Make this less ugly.
......
...@@ -15,6 +15,7 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -15,6 +15,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public bool Has{0} {{", PropertyName); writer.WriteLine("public bool Has{0} {{", PropertyName);
writer.WriteLine(" get {{ return has{0}; }}", PropertyName); writer.WriteLine(" get {{ return has{0}; }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); writer.WriteLine("public {0} {1} {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return {0}_; }}", Name); writer.WriteLine(" get {{ return {0}_; }}", Name);
writer.WriteLine("}"); writer.WriteLine("}");
...@@ -24,10 +25,12 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -24,10 +25,12 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public bool Has{0} {{", PropertyName); writer.WriteLine("public bool Has{0} {{", PropertyName);
writer.WriteLine(" get {{ return result.Has{0}; }}", PropertyName); writer.WriteLine(" get {{ return result.Has{0}; }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); writer.WriteLine("public {0} {1} {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); writer.WriteLine(" get {{ return result.{0}; }}", PropertyName);
writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName);
AddNullCheck(writer); AddNullCheck(writer);
writer.WriteLine(" result.has{0} = true;", PropertyName); writer.WriteLine(" result.has{0} = true;", PropertyName);
......
...@@ -16,6 +16,7 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -16,6 +16,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("private int {0}MemoizedSerializedSize;", Name); writer.WriteLine("private int {0}MemoizedSerializedSize;", Name);
} }
writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name);
AddClsComplianceCheck(writer);
writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name); writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name);
writer.WriteLine("}"); writer.WriteLine("}");
...@@ -25,6 +26,7 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -25,6 +26,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine(" get {{ return {0}_.Count; }}", Name); writer.WriteLine(" get {{ return {0}_.Count; }}", Name);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName);
writer.WriteLine(" return {0}_[index];", Name); writer.WriteLine(" return {0}_[index];", Name);
writer.WriteLine("}"); writer.WriteLine("}");
...@@ -32,25 +34,30 @@ namespace Google.ProtocolBuffers.ProtoGen { ...@@ -32,25 +34,30 @@ namespace Google.ProtocolBuffers.ProtoGen {
public void GenerateBuilderMembers(TextGenerator writer) { public void GenerateBuilderMembers(TextGenerator writer) {
// Note: We can return the original list here, because we make it unmodifiable when we build // Note: We can return the original list here, because we make it unmodifiable when we build
AddClsComplianceCheck(writer);
writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName);
writer.WriteLine(" get {{ return result.{0}_; }}", Name); writer.WriteLine(" get {{ return result.{0}_; }}", Name);
writer.WriteLine("}"); writer.WriteLine("}");
writer.WriteLine("public int {0}Count {{", PropertyName); writer.WriteLine("public int {0}Count {{", PropertyName);
writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName);
writer.WriteLine(" return result.Get{0}(index);", PropertyName); writer.WriteLine(" return result.Get{0}(index);", PropertyName);
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName);
AddNullCheck(writer); AddNullCheck(writer);
writer.WriteLine(" result.{0}_[index] = value;", Name); writer.WriteLine(" result.{0}_[index] = value;", Name);
writer.WriteLine(" return this;"); writer.WriteLine(" return this;");
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName);
AddNullCheck(writer); AddNullCheck(writer);
writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName);
writer.WriteLine(" return this;"); writer.WriteLine(" return this;");
writer.WriteLine("}"); writer.WriteLine("}");
AddClsComplianceCheck(writer);
writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName);
writer.WriteLine(" base.AddRange(values, result.{0}_);", Name); writer.WriteLine(" base.AddRange(values, result.{0}_);", Name);
writer.WriteLine(" return this;"); writer.WriteLine(" return this;");
......
using System;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
...@@ -34,3 +35,6 @@ using System.Runtime.InteropServices; ...@@ -34,3 +35,6 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
// We don't really need CLSCompliance, but if the assembly builds with no warnings,
// that means the generator is okay.
[assembly: CLSCompliant(true)]
...@@ -47,10 +47,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -47,10 +47,12 @@ namespace Google.ProtocolBuffers.TestProtos {
#endregion #endregion
#region Extensions #region Extensions
public const int FileOpt1FieldNumber = 7736974; public const int FileOpt1FieldNumber = 7736974;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> FileOpt1; public static pb::GeneratedExtensionBase<ulong> FileOpt1;
public const int MessageOpt1FieldNumber = 7739036; public const int MessageOpt1FieldNumber = 7739036;
public static pb::GeneratedExtensionBase<int> MessageOpt1; public static pb::GeneratedExtensionBase<int> MessageOpt1;
public const int FieldOpt1FieldNumber = 7740936; public const int FieldOpt1FieldNumber = 7740936;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> FieldOpt1; public static pb::GeneratedExtensionBase<ulong> FieldOpt1;
public const int FieldOpt2FieldNumber = 7753913; public const int FieldOpt2FieldNumber = 7753913;
public static pb::GeneratedExtensionBase<int> FieldOpt2; public static pb::GeneratedExtensionBase<int> FieldOpt2;
...@@ -67,16 +69,20 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -67,16 +69,20 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int Int64OptFieldNumber = 7705542; public const int Int64OptFieldNumber = 7705542;
public static pb::GeneratedExtensionBase<long> Int64Opt; public static pb::GeneratedExtensionBase<long> Int64Opt;
public const int Uint32OptFieldNumber = 7704880; public const int Uint32OptFieldNumber = 7704880;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> Uint32Opt; public static pb::GeneratedExtensionBase<uint> Uint32Opt;
public const int Uint64OptFieldNumber = 7702367; public const int Uint64OptFieldNumber = 7702367;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> Uint64Opt; public static pb::GeneratedExtensionBase<ulong> Uint64Opt;
public const int Sint32OptFieldNumber = 7701568; public const int Sint32OptFieldNumber = 7701568;
public static pb::GeneratedExtensionBase<int> Sint32Opt; public static pb::GeneratedExtensionBase<int> Sint32Opt;
public const int Sint64OptFieldNumber = 7700863; public const int Sint64OptFieldNumber = 7700863;
public static pb::GeneratedExtensionBase<long> Sint64Opt; public static pb::GeneratedExtensionBase<long> Sint64Opt;
public const int Fixed32OptFieldNumber = 7700307; public const int Fixed32OptFieldNumber = 7700307;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> Fixed32Opt; public static pb::GeneratedExtensionBase<uint> Fixed32Opt;
public const int Fixed64OptFieldNumber = 7700194; public const int Fixed64OptFieldNumber = 7700194;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> Fixed64Opt; public static pb::GeneratedExtensionBase<ulong> Fixed64Opt;
public const int Sfixed32OptFieldNumber = 7698645; public const int Sfixed32OptFieldNumber = 7698645;
public static pb::GeneratedExtensionBase<int> Sfixed32Opt; public static pb::GeneratedExtensionBase<int> Sfixed32Opt;
......
...@@ -104,16 +104,20 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -104,16 +104,20 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int OptionalInt64ExtensionFieldNumber = 2; public const int OptionalInt64ExtensionFieldNumber = 2;
public static pb::GeneratedExtensionBase<long> OptionalInt64Extension; public static pb::GeneratedExtensionBase<long> OptionalInt64Extension;
public const int OptionalUint32ExtensionFieldNumber = 3; public const int OptionalUint32ExtensionFieldNumber = 3;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> OptionalUint32Extension; public static pb::GeneratedExtensionBase<uint> OptionalUint32Extension;
public const int OptionalUint64ExtensionFieldNumber = 4; public const int OptionalUint64ExtensionFieldNumber = 4;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> OptionalUint64Extension; public static pb::GeneratedExtensionBase<ulong> OptionalUint64Extension;
public const int OptionalSint32ExtensionFieldNumber = 5; public const int OptionalSint32ExtensionFieldNumber = 5;
public static pb::GeneratedExtensionBase<int> OptionalSint32Extension; public static pb::GeneratedExtensionBase<int> OptionalSint32Extension;
public const int OptionalSint64ExtensionFieldNumber = 6; public const int OptionalSint64ExtensionFieldNumber = 6;
public static pb::GeneratedExtensionBase<long> OptionalSint64Extension; public static pb::GeneratedExtensionBase<long> OptionalSint64Extension;
public const int OptionalFixed32ExtensionFieldNumber = 7; public const int OptionalFixed32ExtensionFieldNumber = 7;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> OptionalFixed32Extension; public static pb::GeneratedExtensionBase<uint> OptionalFixed32Extension;
public const int OptionalFixed64ExtensionFieldNumber = 8; public const int OptionalFixed64ExtensionFieldNumber = 8;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> OptionalFixed64Extension; public static pb::GeneratedExtensionBase<ulong> OptionalFixed64Extension;
public const int OptionalSfixed32ExtensionFieldNumber = 9; public const int OptionalSfixed32ExtensionFieldNumber = 9;
public static pb::GeneratedExtensionBase<int> OptionalSfixed32Extension; public static pb::GeneratedExtensionBase<int> OptionalSfixed32Extension;
...@@ -152,16 +156,20 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -152,16 +156,20 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int RepeatedInt64ExtensionFieldNumber = 32; public const int RepeatedInt64ExtensionFieldNumber = 32;
public static pb::GeneratedExtensionBase<scg::IList<long>> RepeatedInt64Extension; public static pb::GeneratedExtensionBase<scg::IList<long>> RepeatedInt64Extension;
public const int RepeatedUint32ExtensionFieldNumber = 33; public const int RepeatedUint32ExtensionFieldNumber = 33;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedUint32Extension; public static pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedUint32Extension;
public const int RepeatedUint64ExtensionFieldNumber = 34; public const int RepeatedUint64ExtensionFieldNumber = 34;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedUint64Extension; public static pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedUint64Extension;
public const int RepeatedSint32ExtensionFieldNumber = 35; public const int RepeatedSint32ExtensionFieldNumber = 35;
public static pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSint32Extension; public static pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSint32Extension;
public const int RepeatedSint64ExtensionFieldNumber = 36; public const int RepeatedSint64ExtensionFieldNumber = 36;
public static pb::GeneratedExtensionBase<scg::IList<long>> RepeatedSint64Extension; public static pb::GeneratedExtensionBase<scg::IList<long>> RepeatedSint64Extension;
public const int RepeatedFixed32ExtensionFieldNumber = 37; public const int RepeatedFixed32ExtensionFieldNumber = 37;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedFixed32Extension; public static pb::GeneratedExtensionBase<scg::IList<uint>> RepeatedFixed32Extension;
public const int RepeatedFixed64ExtensionFieldNumber = 38; public const int RepeatedFixed64ExtensionFieldNumber = 38;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedFixed64Extension; public static pb::GeneratedExtensionBase<scg::IList<ulong>> RepeatedFixed64Extension;
public const int RepeatedSfixed32ExtensionFieldNumber = 39; public const int RepeatedSfixed32ExtensionFieldNumber = 39;
public static pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSfixed32Extension; public static pb::GeneratedExtensionBase<scg::IList<int>> RepeatedSfixed32Extension;
...@@ -200,16 +208,20 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -200,16 +208,20 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int DefaultInt64ExtensionFieldNumber = 62; public const int DefaultInt64ExtensionFieldNumber = 62;
public static pb::GeneratedExtensionBase<long> DefaultInt64Extension; public static pb::GeneratedExtensionBase<long> DefaultInt64Extension;
public const int DefaultUint32ExtensionFieldNumber = 63; public const int DefaultUint32ExtensionFieldNumber = 63;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> DefaultUint32Extension; public static pb::GeneratedExtensionBase<uint> DefaultUint32Extension;
public const int DefaultUint64ExtensionFieldNumber = 64; public const int DefaultUint64ExtensionFieldNumber = 64;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> DefaultUint64Extension; public static pb::GeneratedExtensionBase<ulong> DefaultUint64Extension;
public const int DefaultSint32ExtensionFieldNumber = 65; public const int DefaultSint32ExtensionFieldNumber = 65;
public static pb::GeneratedExtensionBase<int> DefaultSint32Extension; public static pb::GeneratedExtensionBase<int> DefaultSint32Extension;
public const int DefaultSint64ExtensionFieldNumber = 66; public const int DefaultSint64ExtensionFieldNumber = 66;
public static pb::GeneratedExtensionBase<long> DefaultSint64Extension; public static pb::GeneratedExtensionBase<long> DefaultSint64Extension;
public const int DefaultFixed32ExtensionFieldNumber = 67; public const int DefaultFixed32ExtensionFieldNumber = 67;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<uint> DefaultFixed32Extension; public static pb::GeneratedExtensionBase<uint> DefaultFixed32Extension;
public const int DefaultFixed64ExtensionFieldNumber = 68; public const int DefaultFixed64ExtensionFieldNumber = 68;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<ulong> DefaultFixed64Extension; public static pb::GeneratedExtensionBase<ulong> DefaultFixed64Extension;
public const int DefaultSfixed32ExtensionFieldNumber = 69; public const int DefaultSfixed32ExtensionFieldNumber = 69;
public static pb::GeneratedExtensionBase<int> DefaultSfixed32Extension; public static pb::GeneratedExtensionBase<int> DefaultSfixed32Extension;
...@@ -244,16 +256,20 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -244,16 +256,20 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int PackedInt64ExtensionFieldNumber = 91; public const int PackedInt64ExtensionFieldNumber = 91;
public static pb::GeneratedExtensionBase<scg::IList<long>> PackedInt64Extension; public static pb::GeneratedExtensionBase<scg::IList<long>> PackedInt64Extension;
public const int PackedUint32ExtensionFieldNumber = 92; public const int PackedUint32ExtensionFieldNumber = 92;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<uint>> PackedUint32Extension; public static pb::GeneratedExtensionBase<scg::IList<uint>> PackedUint32Extension;
public const int PackedUint64ExtensionFieldNumber = 93; public const int PackedUint64ExtensionFieldNumber = 93;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<ulong>> PackedUint64Extension; public static pb::GeneratedExtensionBase<scg::IList<ulong>> PackedUint64Extension;
public const int PackedSint32ExtensionFieldNumber = 94; public const int PackedSint32ExtensionFieldNumber = 94;
public static pb::GeneratedExtensionBase<scg::IList<int>> PackedSint32Extension; public static pb::GeneratedExtensionBase<scg::IList<int>> PackedSint32Extension;
public const int PackedSint64ExtensionFieldNumber = 95; public const int PackedSint64ExtensionFieldNumber = 95;
public static pb::GeneratedExtensionBase<scg::IList<long>> PackedSint64Extension; public static pb::GeneratedExtensionBase<scg::IList<long>> PackedSint64Extension;
public const int PackedFixed32ExtensionFieldNumber = 96; public const int PackedFixed32ExtensionFieldNumber = 96;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<uint>> PackedFixed32Extension; public static pb::GeneratedExtensionBase<scg::IList<uint>> PackedFixed32Extension;
public const int PackedFixed64ExtensionFieldNumber = 97; public const int PackedFixed64ExtensionFieldNumber = 97;
[global::System.CLSCompliant(false)]
public static pb::GeneratedExtensionBase<scg::IList<ulong>> PackedFixed64Extension; public static pb::GeneratedExtensionBase<scg::IList<ulong>> PackedFixed64Extension;
public const int PackedSfixed32ExtensionFieldNumber = 98; public const int PackedSfixed32ExtensionFieldNumber = 98;
public static pb::GeneratedExtensionBase<scg::IList<int>> PackedSfixed32Extension; public static pb::GeneratedExtensionBase<scg::IList<int>> PackedSfixed32Extension;
...@@ -1605,6 +1621,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1605,6 +1621,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalUint32 { public bool HasOptionalUint32 {
get { return hasOptionalUint32; } get { return hasOptionalUint32; }
} }
[global::System.CLSCompliant(false)]
public uint OptionalUint32 { public uint OptionalUint32 {
get { return optionalUint32_; } get { return optionalUint32_; }
} }
...@@ -1615,6 +1632,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1615,6 +1632,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalUint64 { public bool HasOptionalUint64 {
get { return hasOptionalUint64; } get { return hasOptionalUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong OptionalUint64 { public ulong OptionalUint64 {
get { return optionalUint64_; } get { return optionalUint64_; }
} }
...@@ -1645,6 +1663,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1645,6 +1663,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalFixed32 { public bool HasOptionalFixed32 {
get { return hasOptionalFixed32; } get { return hasOptionalFixed32; }
} }
[global::System.CLSCompliant(false)]
public uint OptionalFixed32 { public uint OptionalFixed32 {
get { return optionalFixed32_; } get { return optionalFixed32_; }
} }
...@@ -1655,6 +1674,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1655,6 +1674,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalFixed64 { public bool HasOptionalFixed64 {
get { return hasOptionalFixed64; } get { return hasOptionalFixed64; }
} }
[global::System.CLSCompliant(false)]
public ulong OptionalFixed64 { public ulong OptionalFixed64 {
get { return optionalFixed64_; } get { return optionalFixed64_; }
} }
...@@ -1845,24 +1865,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1845,24 +1865,28 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int RepeatedUint32FieldNumber = 33; public const int RepeatedUint32FieldNumber = 33;
private pbc::PopsicleList<uint> repeatedUint32_ = new pbc::PopsicleList<uint>(); private pbc::PopsicleList<uint> repeatedUint32_ = new pbc::PopsicleList<uint>();
[global::System.CLSCompliant(false)]
public scg::IList<uint> RepeatedUint32List { public scg::IList<uint> RepeatedUint32List {
get { return pbc::Lists.AsReadOnly(repeatedUint32_); } get { return pbc::Lists.AsReadOnly(repeatedUint32_); }
} }
public int RepeatedUint32Count { public int RepeatedUint32Count {
get { return repeatedUint32_.Count; } get { return repeatedUint32_.Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetRepeatedUint32(int index) { public uint GetRepeatedUint32(int index) {
return repeatedUint32_[index]; return repeatedUint32_[index];
} }
public const int RepeatedUint64FieldNumber = 34; public const int RepeatedUint64FieldNumber = 34;
private pbc::PopsicleList<ulong> repeatedUint64_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> repeatedUint64_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> RepeatedUint64List { public scg::IList<ulong> RepeatedUint64List {
get { return pbc::Lists.AsReadOnly(repeatedUint64_); } get { return pbc::Lists.AsReadOnly(repeatedUint64_); }
} }
public int RepeatedUint64Count { public int RepeatedUint64Count {
get { return repeatedUint64_.Count; } get { return repeatedUint64_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetRepeatedUint64(int index) { public ulong GetRepeatedUint64(int index) {
return repeatedUint64_[index]; return repeatedUint64_[index];
} }
...@@ -1893,24 +1917,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -1893,24 +1917,28 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int RepeatedFixed32FieldNumber = 37; public const int RepeatedFixed32FieldNumber = 37;
private pbc::PopsicleList<uint> repeatedFixed32_ = new pbc::PopsicleList<uint>(); private pbc::PopsicleList<uint> repeatedFixed32_ = new pbc::PopsicleList<uint>();
[global::System.CLSCompliant(false)]
public scg::IList<uint> RepeatedFixed32List { public scg::IList<uint> RepeatedFixed32List {
get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } get { return pbc::Lists.AsReadOnly(repeatedFixed32_); }
} }
public int RepeatedFixed32Count { public int RepeatedFixed32Count {
get { return repeatedFixed32_.Count; } get { return repeatedFixed32_.Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetRepeatedFixed32(int index) { public uint GetRepeatedFixed32(int index) {
return repeatedFixed32_[index]; return repeatedFixed32_[index];
} }
public const int RepeatedFixed64FieldNumber = 38; public const int RepeatedFixed64FieldNumber = 38;
private pbc::PopsicleList<ulong> repeatedFixed64_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> repeatedFixed64_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> RepeatedFixed64List { public scg::IList<ulong> RepeatedFixed64List {
get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } get { return pbc::Lists.AsReadOnly(repeatedFixed64_); }
} }
public int RepeatedFixed64Count { public int RepeatedFixed64Count {
get { return repeatedFixed64_.Count; } get { return repeatedFixed64_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetRepeatedFixed64(int index) { public ulong GetRepeatedFixed64(int index) {
return repeatedFixed64_[index]; return repeatedFixed64_[index];
} }
...@@ -2133,6 +2161,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2133,6 +2161,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultUint32 { public bool HasDefaultUint32 {
get { return hasDefaultUint32; } get { return hasDefaultUint32; }
} }
[global::System.CLSCompliant(false)]
public uint DefaultUint32 { public uint DefaultUint32 {
get { return defaultUint32_; } get { return defaultUint32_; }
} }
...@@ -2143,6 +2172,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2143,6 +2172,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultUint64 { public bool HasDefaultUint64 {
get { return hasDefaultUint64; } get { return hasDefaultUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong DefaultUint64 { public ulong DefaultUint64 {
get { return defaultUint64_; } get { return defaultUint64_; }
} }
...@@ -2173,6 +2203,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2173,6 +2203,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultFixed32 { public bool HasDefaultFixed32 {
get { return hasDefaultFixed32; } get { return hasDefaultFixed32; }
} }
[global::System.CLSCompliant(false)]
public uint DefaultFixed32 { public uint DefaultFixed32 {
get { return defaultFixed32_; } get { return defaultFixed32_; }
} }
...@@ -2183,6 +2214,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -2183,6 +2214,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultFixed64 { public bool HasDefaultFixed64 {
get { return hasDefaultFixed64; } get { return hasDefaultFixed64; }
} }
[global::System.CLSCompliant(false)]
public ulong DefaultFixed64 { public ulong DefaultFixed64 {
get { return defaultFixed64_; } get { return defaultFixed64_; }
} }
...@@ -3632,10 +3664,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3632,10 +3664,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalUint32 { public bool HasOptionalUint32 {
get { return result.HasOptionalUint32; } get { return result.HasOptionalUint32; }
} }
[global::System.CLSCompliant(false)]
public uint OptionalUint32 { public uint OptionalUint32 {
get { return result.OptionalUint32; } get { return result.OptionalUint32; }
set { SetOptionalUint32(value); } set { SetOptionalUint32(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetOptionalUint32(uint value) { public Builder SetOptionalUint32(uint value) {
result.hasOptionalUint32 = true; result.hasOptionalUint32 = true;
result.optionalUint32_ = value; result.optionalUint32_ = value;
...@@ -3650,10 +3684,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3650,10 +3684,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalUint64 { public bool HasOptionalUint64 {
get { return result.HasOptionalUint64; } get { return result.HasOptionalUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong OptionalUint64 { public ulong OptionalUint64 {
get { return result.OptionalUint64; } get { return result.OptionalUint64; }
set { SetOptionalUint64(value); } set { SetOptionalUint64(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetOptionalUint64(ulong value) { public Builder SetOptionalUint64(ulong value) {
result.hasOptionalUint64 = true; result.hasOptionalUint64 = true;
result.optionalUint64_ = value; result.optionalUint64_ = value;
...@@ -3704,10 +3740,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3704,10 +3740,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalFixed32 { public bool HasOptionalFixed32 {
get { return result.HasOptionalFixed32; } get { return result.HasOptionalFixed32; }
} }
[global::System.CLSCompliant(false)]
public uint OptionalFixed32 { public uint OptionalFixed32 {
get { return result.OptionalFixed32; } get { return result.OptionalFixed32; }
set { SetOptionalFixed32(value); } set { SetOptionalFixed32(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetOptionalFixed32(uint value) { public Builder SetOptionalFixed32(uint value) {
result.hasOptionalFixed32 = true; result.hasOptionalFixed32 = true;
result.optionalFixed32_ = value; result.optionalFixed32_ = value;
...@@ -3722,10 +3760,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -3722,10 +3760,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasOptionalFixed64 { public bool HasOptionalFixed64 {
get { return result.HasOptionalFixed64; } get { return result.HasOptionalFixed64; }
} }
[global::System.CLSCompliant(false)]
public ulong OptionalFixed64 { public ulong OptionalFixed64 {
get { return result.OptionalFixed64; } get { return result.OptionalFixed64; }
set { SetOptionalFixed64(value); } set { SetOptionalFixed64(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetOptionalFixed64(ulong value) { public Builder SetOptionalFixed64(ulong value) {
result.hasOptionalFixed64 = true; result.hasOptionalFixed64 = true;
result.optionalFixed64_ = value; result.optionalFixed64_ = value;
...@@ -4153,23 +4193,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4153,23 +4193,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<uint> RepeatedUint32List { public scg::IList<uint> RepeatedUint32List {
get { return result.repeatedUint32_; } get { return result.repeatedUint32_; }
} }
public int RepeatedUint32Count { public int RepeatedUint32Count {
get { return result.RepeatedUint32Count; } get { return result.RepeatedUint32Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetRepeatedUint32(int index) { public uint GetRepeatedUint32(int index) {
return result.GetRepeatedUint32(index); return result.GetRepeatedUint32(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetRepeatedUint32(int index, uint value) { public Builder SetRepeatedUint32(int index, uint value) {
result.repeatedUint32_[index] = value; result.repeatedUint32_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRepeatedUint32(uint value) { public Builder AddRepeatedUint32(uint value) {
result.repeatedUint32_.Add(value); result.repeatedUint32_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) { public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) {
base.AddRange(values, result.repeatedUint32_); base.AddRange(values, result.repeatedUint32_);
return this; return this;
...@@ -4179,23 +4224,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4179,23 +4224,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<ulong> RepeatedUint64List { public scg::IList<ulong> RepeatedUint64List {
get { return result.repeatedUint64_; } get { return result.repeatedUint64_; }
} }
public int RepeatedUint64Count { public int RepeatedUint64Count {
get { return result.RepeatedUint64Count; } get { return result.RepeatedUint64Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetRepeatedUint64(int index) { public ulong GetRepeatedUint64(int index) {
return result.GetRepeatedUint64(index); return result.GetRepeatedUint64(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetRepeatedUint64(int index, ulong value) { public Builder SetRepeatedUint64(int index, ulong value) {
result.repeatedUint64_[index] = value; result.repeatedUint64_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRepeatedUint64(ulong value) { public Builder AddRepeatedUint64(ulong value) {
result.repeatedUint64_.Add(value); result.repeatedUint64_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) { public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) {
base.AddRange(values, result.repeatedUint64_); base.AddRange(values, result.repeatedUint64_);
return this; return this;
...@@ -4257,23 +4307,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4257,23 +4307,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<uint> RepeatedFixed32List { public scg::IList<uint> RepeatedFixed32List {
get { return result.repeatedFixed32_; } get { return result.repeatedFixed32_; }
} }
public int RepeatedFixed32Count { public int RepeatedFixed32Count {
get { return result.RepeatedFixed32Count; } get { return result.RepeatedFixed32Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetRepeatedFixed32(int index) { public uint GetRepeatedFixed32(int index) {
return result.GetRepeatedFixed32(index); return result.GetRepeatedFixed32(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetRepeatedFixed32(int index, uint value) { public Builder SetRepeatedFixed32(int index, uint value) {
result.repeatedFixed32_[index] = value; result.repeatedFixed32_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRepeatedFixed32(uint value) { public Builder AddRepeatedFixed32(uint value) {
result.repeatedFixed32_.Add(value); result.repeatedFixed32_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) { public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) {
base.AddRange(values, result.repeatedFixed32_); base.AddRange(values, result.repeatedFixed32_);
return this; return this;
...@@ -4283,23 +4338,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4283,23 +4338,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<ulong> RepeatedFixed64List { public scg::IList<ulong> RepeatedFixed64List {
get { return result.repeatedFixed64_; } get { return result.repeatedFixed64_; }
} }
public int RepeatedFixed64Count { public int RepeatedFixed64Count {
get { return result.RepeatedFixed64Count; } get { return result.RepeatedFixed64Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetRepeatedFixed64(int index) { public ulong GetRepeatedFixed64(int index) {
return result.GetRepeatedFixed64(index); return result.GetRepeatedFixed64(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetRepeatedFixed64(int index, ulong value) { public Builder SetRepeatedFixed64(int index, ulong value) {
result.repeatedFixed64_[index] = value; result.repeatedFixed64_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRepeatedFixed64(ulong value) { public Builder AddRepeatedFixed64(ulong value) {
result.repeatedFixed64_.Add(value); result.repeatedFixed64_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) { public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) {
base.AddRange(values, result.repeatedFixed64_); base.AddRange(values, result.repeatedFixed64_);
return this; return this;
...@@ -4820,10 +4880,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4820,10 +4880,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultUint32 { public bool HasDefaultUint32 {
get { return result.HasDefaultUint32; } get { return result.HasDefaultUint32; }
} }
[global::System.CLSCompliant(false)]
public uint DefaultUint32 { public uint DefaultUint32 {
get { return result.DefaultUint32; } get { return result.DefaultUint32; }
set { SetDefaultUint32(value); } set { SetDefaultUint32(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetDefaultUint32(uint value) { public Builder SetDefaultUint32(uint value) {
result.hasDefaultUint32 = true; result.hasDefaultUint32 = true;
result.defaultUint32_ = value; result.defaultUint32_ = value;
...@@ -4838,10 +4900,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4838,10 +4900,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultUint64 { public bool HasDefaultUint64 {
get { return result.HasDefaultUint64; } get { return result.HasDefaultUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong DefaultUint64 { public ulong DefaultUint64 {
get { return result.DefaultUint64; } get { return result.DefaultUint64; }
set { SetDefaultUint64(value); } set { SetDefaultUint64(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetDefaultUint64(ulong value) { public Builder SetDefaultUint64(ulong value) {
result.hasDefaultUint64 = true; result.hasDefaultUint64 = true;
result.defaultUint64_ = value; result.defaultUint64_ = value;
...@@ -4892,10 +4956,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4892,10 +4956,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultFixed32 { public bool HasDefaultFixed32 {
get { return result.HasDefaultFixed32; } get { return result.HasDefaultFixed32; }
} }
[global::System.CLSCompliant(false)]
public uint DefaultFixed32 { public uint DefaultFixed32 {
get { return result.DefaultFixed32; } get { return result.DefaultFixed32; }
set { SetDefaultFixed32(value); } set { SetDefaultFixed32(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetDefaultFixed32(uint value) { public Builder SetDefaultFixed32(uint value) {
result.hasDefaultFixed32 = true; result.hasDefaultFixed32 = true;
result.defaultFixed32_ = value; result.defaultFixed32_ = value;
...@@ -4910,10 +4976,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -4910,10 +4976,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasDefaultFixed64 { public bool HasDefaultFixed64 {
get { return result.HasDefaultFixed64; } get { return result.HasDefaultFixed64; }
} }
[global::System.CLSCompliant(false)]
public ulong DefaultFixed64 { public ulong DefaultFixed64 {
get { return result.DefaultFixed64; } get { return result.DefaultFixed64; }
set { SetDefaultFixed64(value); } set { SetDefaultFixed64(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetDefaultFixed64(ulong value) { public Builder SetDefaultFixed64(ulong value) {
result.hasDefaultFixed64 = true; result.hasDefaultFixed64 = true;
result.defaultFixed64_ = value; result.defaultFixed64_ = value;
...@@ -11975,6 +12043,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -11975,6 +12043,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasLargeUint32 { public bool HasLargeUint32 {
get { return hasLargeUint32; } get { return hasLargeUint32; }
} }
[global::System.CLSCompliant(false)]
public uint LargeUint32 { public uint LargeUint32 {
get { return largeUint32_; } get { return largeUint32_; }
} }
...@@ -11985,6 +12054,7 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -11985,6 +12054,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasLargeUint64 { public bool HasLargeUint64 {
get { return hasLargeUint64; } get { return hasLargeUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong LargeUint64 { public ulong LargeUint64 {
get { return largeUint64_; } get { return largeUint64_; }
} }
...@@ -12265,10 +12335,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12265,10 +12335,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasLargeUint32 { public bool HasLargeUint32 {
get { return result.HasLargeUint32; } get { return result.HasLargeUint32; }
} }
[global::System.CLSCompliant(false)]
public uint LargeUint32 { public uint LargeUint32 {
get { return result.LargeUint32; } get { return result.LargeUint32; }
set { SetLargeUint32(value); } set { SetLargeUint32(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetLargeUint32(uint value) { public Builder SetLargeUint32(uint value) {
result.hasLargeUint32 = true; result.hasLargeUint32 = true;
result.largeUint32_ = value; result.largeUint32_ = value;
...@@ -12283,10 +12355,12 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12283,10 +12355,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public bool HasLargeUint64 { public bool HasLargeUint64 {
get { return result.HasLargeUint64; } get { return result.HasLargeUint64; }
} }
[global::System.CLSCompliant(false)]
public ulong LargeUint64 { public ulong LargeUint64 {
get { return result.LargeUint64; } get { return result.LargeUint64; }
set { SetLargeUint64(value); } set { SetLargeUint64(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetLargeUint64(ulong value) { public Builder SetLargeUint64(ulong value) {
result.hasLargeUint64 = true; result.hasLargeUint64 = true;
result.largeUint64_ = value; result.largeUint64_ = value;
...@@ -12409,12 +12483,14 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12409,12 +12483,14 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int PackedUint32FieldNumber = 92; public const int PackedUint32FieldNumber = 92;
private int packedUint32MemoizedSerializedSize; private int packedUint32MemoizedSerializedSize;
private pbc::PopsicleList<uint> packedUint32_ = new pbc::PopsicleList<uint>(); private pbc::PopsicleList<uint> packedUint32_ = new pbc::PopsicleList<uint>();
[global::System.CLSCompliant(false)]
public scg::IList<uint> PackedUint32List { public scg::IList<uint> PackedUint32List {
get { return pbc::Lists.AsReadOnly(packedUint32_); } get { return pbc::Lists.AsReadOnly(packedUint32_); }
} }
public int PackedUint32Count { public int PackedUint32Count {
get { return packedUint32_.Count; } get { return packedUint32_.Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetPackedUint32(int index) { public uint GetPackedUint32(int index) {
return packedUint32_[index]; return packedUint32_[index];
} }
...@@ -12422,12 +12498,14 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12422,12 +12498,14 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int PackedUint64FieldNumber = 93; public const int PackedUint64FieldNumber = 93;
private int packedUint64MemoizedSerializedSize; private int packedUint64MemoizedSerializedSize;
private pbc::PopsicleList<ulong> packedUint64_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> packedUint64_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> PackedUint64List { public scg::IList<ulong> PackedUint64List {
get { return pbc::Lists.AsReadOnly(packedUint64_); } get { return pbc::Lists.AsReadOnly(packedUint64_); }
} }
public int PackedUint64Count { public int PackedUint64Count {
get { return packedUint64_.Count; } get { return packedUint64_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetPackedUint64(int index) { public ulong GetPackedUint64(int index) {
return packedUint64_[index]; return packedUint64_[index];
} }
...@@ -12461,12 +12539,14 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12461,12 +12539,14 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int PackedFixed32FieldNumber = 96; public const int PackedFixed32FieldNumber = 96;
private int packedFixed32MemoizedSerializedSize; private int packedFixed32MemoizedSerializedSize;
private pbc::PopsicleList<uint> packedFixed32_ = new pbc::PopsicleList<uint>(); private pbc::PopsicleList<uint> packedFixed32_ = new pbc::PopsicleList<uint>();
[global::System.CLSCompliant(false)]
public scg::IList<uint> PackedFixed32List { public scg::IList<uint> PackedFixed32List {
get { return pbc::Lists.AsReadOnly(packedFixed32_); } get { return pbc::Lists.AsReadOnly(packedFixed32_); }
} }
public int PackedFixed32Count { public int PackedFixed32Count {
get { return packedFixed32_.Count; } get { return packedFixed32_.Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetPackedFixed32(int index) { public uint GetPackedFixed32(int index) {
return packedFixed32_[index]; return packedFixed32_[index];
} }
...@@ -12474,12 +12554,14 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -12474,12 +12554,14 @@ namespace Google.ProtocolBuffers.TestProtos {
public const int PackedFixed64FieldNumber = 97; public const int PackedFixed64FieldNumber = 97;
private int packedFixed64MemoizedSerializedSize; private int packedFixed64MemoizedSerializedSize;
private pbc::PopsicleList<ulong> packedFixed64_ = new pbc::PopsicleList<ulong>(); private pbc::PopsicleList<ulong> packedFixed64_ = new pbc::PopsicleList<ulong>();
[global::System.CLSCompliant(false)]
public scg::IList<ulong> PackedFixed64List { public scg::IList<ulong> PackedFixed64List {
get { return pbc::Lists.AsReadOnly(packedFixed64_); } get { return pbc::Lists.AsReadOnly(packedFixed64_); }
} }
public int PackedFixed64Count { public int PackedFixed64Count {
get { return packedFixed64_.Count; } get { return packedFixed64_.Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetPackedFixed64(int index) { public ulong GetPackedFixed64(int index) {
return packedFixed64_[index]; return packedFixed64_[index];
} }
...@@ -13176,23 +13258,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -13176,23 +13258,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<uint> PackedUint32List { public scg::IList<uint> PackedUint32List {
get { return result.packedUint32_; } get { return result.packedUint32_; }
} }
public int PackedUint32Count { public int PackedUint32Count {
get { return result.PackedUint32Count; } get { return result.PackedUint32Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetPackedUint32(int index) { public uint GetPackedUint32(int index) {
return result.GetPackedUint32(index); return result.GetPackedUint32(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetPackedUint32(int index, uint value) { public Builder SetPackedUint32(int index, uint value) {
result.packedUint32_[index] = value; result.packedUint32_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddPackedUint32(uint value) { public Builder AddPackedUint32(uint value) {
result.packedUint32_.Add(value); result.packedUint32_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangePackedUint32(scg::IEnumerable<uint> values) { public Builder AddRangePackedUint32(scg::IEnumerable<uint> values) {
base.AddRange(values, result.packedUint32_); base.AddRange(values, result.packedUint32_);
return this; return this;
...@@ -13202,23 +13289,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -13202,23 +13289,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<ulong> PackedUint64List { public scg::IList<ulong> PackedUint64List {
get { return result.packedUint64_; } get { return result.packedUint64_; }
} }
public int PackedUint64Count { public int PackedUint64Count {
get { return result.PackedUint64Count; } get { return result.PackedUint64Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetPackedUint64(int index) { public ulong GetPackedUint64(int index) {
return result.GetPackedUint64(index); return result.GetPackedUint64(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetPackedUint64(int index, ulong value) { public Builder SetPackedUint64(int index, ulong value) {
result.packedUint64_[index] = value; result.packedUint64_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddPackedUint64(ulong value) { public Builder AddPackedUint64(ulong value) {
result.packedUint64_.Add(value); result.packedUint64_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangePackedUint64(scg::IEnumerable<ulong> values) { public Builder AddRangePackedUint64(scg::IEnumerable<ulong> values) {
base.AddRange(values, result.packedUint64_); base.AddRange(values, result.packedUint64_);
return this; return this;
...@@ -13280,23 +13372,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -13280,23 +13372,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<uint> PackedFixed32List { public scg::IList<uint> PackedFixed32List {
get { return result.packedFixed32_; } get { return result.packedFixed32_; }
} }
public int PackedFixed32Count { public int PackedFixed32Count {
get { return result.PackedFixed32Count; } get { return result.PackedFixed32Count; }
} }
[global::System.CLSCompliant(false)]
public uint GetPackedFixed32(int index) { public uint GetPackedFixed32(int index) {
return result.GetPackedFixed32(index); return result.GetPackedFixed32(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetPackedFixed32(int index, uint value) { public Builder SetPackedFixed32(int index, uint value) {
result.packedFixed32_[index] = value; result.packedFixed32_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddPackedFixed32(uint value) { public Builder AddPackedFixed32(uint value) {
result.packedFixed32_.Add(value); result.packedFixed32_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangePackedFixed32(scg::IEnumerable<uint> values) { public Builder AddRangePackedFixed32(scg::IEnumerable<uint> values) {
base.AddRange(values, result.packedFixed32_); base.AddRange(values, result.packedFixed32_);
return this; return this;
...@@ -13306,23 +13403,28 @@ namespace Google.ProtocolBuffers.TestProtos { ...@@ -13306,23 +13403,28 @@ namespace Google.ProtocolBuffers.TestProtos {
return this; return this;
} }
[global::System.CLSCompliant(false)]
public scg::IList<ulong> PackedFixed64List { public scg::IList<ulong> PackedFixed64List {
get { return result.packedFixed64_; } get { return result.packedFixed64_; }
} }
public int PackedFixed64Count { public int PackedFixed64Count {
get { return result.PackedFixed64Count; } get { return result.PackedFixed64Count; }
} }
[global::System.CLSCompliant(false)]
public ulong GetPackedFixed64(int index) { public ulong GetPackedFixed64(int index) {
return result.GetPackedFixed64(index); return result.GetPackedFixed64(index);
} }
[global::System.CLSCompliant(false)]
public Builder SetPackedFixed64(int index, ulong value) { public Builder SetPackedFixed64(int index, ulong value) {
result.packedFixed64_[index] = value; result.packedFixed64_[index] = value;
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddPackedFixed64(ulong value) { public Builder AddPackedFixed64(ulong value) {
result.packedFixed64_.Add(value); result.packedFixed64_.Add(value);
return this; return this;
} }
[global::System.CLSCompliant(false)]
public Builder AddRangePackedFixed64(scg::IEnumerable<ulong> values) { public Builder AddRangePackedFixed64(scg::IEnumerable<ulong> values) {
base.AddRange(values, result.packedFixed64_); base.AddRange(values, result.packedFixed64_);
return this; return this;
......
...@@ -126,6 +126,7 @@ namespace Google.ProtocolBuffers { ...@@ -126,6 +126,7 @@ namespace Google.ProtocolBuffers {
/// </summary> /// </summary>
/// <exception cref="InvalidProtocolBufferException">The last /// <exception cref="InvalidProtocolBufferException">The last
/// tag read was not the one specified</exception> /// tag read was not the one specified</exception>
[CLSCompliant(false)]
public void CheckLastTagWas(uint value) { public void CheckLastTagWas(uint value) {
if (lastTag != value) { if (lastTag != value) {
throw InvalidProtocolBufferException.InvalidEndTag(); throw InvalidProtocolBufferException.InvalidEndTag();
...@@ -140,6 +141,7 @@ namespace Google.ProtocolBuffers { ...@@ -140,6 +141,7 @@ namespace Google.ProtocolBuffers {
/// since a protocol message may legally end wherever a tag occurs, and /// since a protocol message may legally end wherever a tag occurs, and
/// zero is not a valid tag number. /// zero is not a valid tag number.
/// </summary> /// </summary>
[CLSCompliant(false)]
public uint ReadTag() { public uint ReadTag() {
if (IsAtEnd) { if (IsAtEnd) {
lastTag = 0; lastTag = 0;
...@@ -175,6 +177,7 @@ namespace Google.ProtocolBuffers { ...@@ -175,6 +177,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a uint64 field from the stream. /// Read a uint64 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public ulong ReadUInt64() { public ulong ReadUInt64() {
return ReadRawVarint64(); return ReadRawVarint64();
} }
...@@ -196,6 +199,7 @@ namespace Google.ProtocolBuffers { ...@@ -196,6 +199,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a fixed64 field from the stream. /// Read a fixed64 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public ulong ReadFixed64() { public ulong ReadFixed64() {
return ReadRawLittleEndian64(); return ReadRawLittleEndian64();
} }
...@@ -203,6 +207,7 @@ namespace Google.ProtocolBuffers { ...@@ -203,6 +207,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a fixed32 field from the stream. /// Read a fixed32 field from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public uint ReadFixed32() { public uint ReadFixed32() {
return ReadRawLittleEndian32(); return ReadRawLittleEndian32();
} }
...@@ -298,6 +303,7 @@ namespace Google.ProtocolBuffers { ...@@ -298,6 +303,7 @@ 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)]
public uint ReadUInt32() { public uint ReadUInt32() {
return ReadRawVarint32(); return ReadRawVarint32();
} }
...@@ -418,6 +424,7 @@ namespace Google.ProtocolBuffers { ...@@ -418,6 +424,7 @@ namespace Google.ProtocolBuffers {
/// That means we can check the size just once, then just read directly from the buffer /// That means we can check the size just once, then just read directly from the buffer
/// without constant rechecking of the buffer length. /// without constant rechecking of the buffer length.
/// </summary> /// </summary>
[CLSCompliant(false)]
public uint ReadRawVarint32() { public uint ReadRawVarint32() {
if (bufferPos + 5 > bufferSize) { if (bufferPos + 5 > bufferSize) {
return SlowReadRawVarint32(); return SlowReadRawVarint32();
...@@ -495,6 +502,7 @@ namespace Google.ProtocolBuffers { ...@@ -495,6 +502,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a raw varint from the stream. /// Read a raw varint from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public ulong ReadRawVarint64() { public ulong ReadRawVarint64() {
int shift = 0; int shift = 0;
ulong result = 0; ulong result = 0;
...@@ -512,6 +520,7 @@ namespace Google.ProtocolBuffers { ...@@ -512,6 +520,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a 32-bit little-endian integer from the stream. /// Read a 32-bit little-endian integer from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public uint ReadRawLittleEndian32() { public uint ReadRawLittleEndian32() {
uint b1 = ReadRawByte(); uint b1 = ReadRawByte();
uint b2 = ReadRawByte(); uint b2 = ReadRawByte();
...@@ -523,6 +532,7 @@ namespace Google.ProtocolBuffers { ...@@ -523,6 +532,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Read a 64-bit little-endian integer from the stream. /// Read a 64-bit little-endian integer from the stream.
/// </summary> /// </summary>
[CLSCompliant(false)]
public ulong ReadRawLittleEndian64() { public ulong ReadRawLittleEndian64() {
ulong b1 = ReadRawByte(); ulong b1 = ReadRawByte();
ulong b2 = ReadRawByte(); ulong b2 = ReadRawByte();
...@@ -546,6 +556,7 @@ namespace Google.ProtocolBuffers { ...@@ -546,6 +556,7 @@ 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 int DecodeZigZag32(uint n) { public static int DecodeZigZag32(uint n) {
return (int)(n >> 1) ^ -(int)(n & 1); return (int)(n >> 1) ^ -(int)(n & 1);
} }
...@@ -559,6 +570,7 @@ namespace Google.ProtocolBuffers { ...@@ -559,6 +570,7 @@ 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 long DecodeZigZag64(ulong n) { public static long DecodeZigZag64(ulong n) {
return (long)(n >> 1) ^ -(long)(n & 1); return (long)(n >> 1) ^ -(long)(n & 1);
} }
...@@ -849,6 +861,7 @@ namespace Google.ProtocolBuffers { ...@@ -849,6 +861,7 @@ 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)]
public bool SkipField(uint tag) { public bool SkipField(uint tag) {
switch (WireFormat.GetTagWireType(tag)) { switch (WireFormat.GetTagWireType(tag)) {
case WireFormat.WireType.Varint: case WireFormat.WireType.Varint:
......
...@@ -133,6 +133,7 @@ namespace Google.ProtocolBuffers { ...@@ -133,6 +133,7 @@ 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, ulong value) { public void WriteUInt64(int fieldNumber, ulong value) {
WriteTag(fieldNumber, WireFormat.WireType.Varint); WriteTag(fieldNumber, WireFormat.WireType.Varint);
WriteRawVarint64(value); WriteRawVarint64(value);
...@@ -162,6 +163,7 @@ namespace Google.ProtocolBuffers { ...@@ -162,6 +163,7 @@ 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, ulong value) { public void WriteFixed64(int fieldNumber, ulong value) {
WriteTag(fieldNumber, WireFormat.WireType.Fixed64); WriteTag(fieldNumber, WireFormat.WireType.Fixed64);
WriteRawLittleEndian64(value); WriteRawLittleEndian64(value);
...@@ -170,6 +172,7 @@ namespace Google.ProtocolBuffers { ...@@ -170,6 +172,7 @@ 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, uint value) { public void WriteFixed32(int fieldNumber, uint value) {
WriteTag(fieldNumber, WireFormat.WireType.Fixed32); WriteTag(fieldNumber, WireFormat.WireType.Fixed32);
WriteRawLittleEndian32(value); WriteRawLittleEndian32(value);
...@@ -230,6 +233,7 @@ namespace Google.ProtocolBuffers { ...@@ -230,6 +233,7 @@ namespace Google.ProtocolBuffers {
WriteRawBytes(bytes); WriteRawBytes(bytes);
} }
[CLSCompliant(false)]
public void WriteUInt32(int fieldNumber, uint value) { public void WriteUInt32(int fieldNumber, uint value) {
WriteTag(fieldNumber, WireFormat.WireType.Varint); WriteTag(fieldNumber, WireFormat.WireType.Varint);
WriteRawVarint32(value); WriteRawVarint32(value);
...@@ -344,6 +348,7 @@ namespace Google.ProtocolBuffers { ...@@ -344,6 +348,7 @@ 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);
} }
...@@ -370,6 +375,7 @@ namespace Google.ProtocolBuffers { ...@@ -370,6 +375,7 @@ 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);
} }
...@@ -377,6 +383,7 @@ namespace Google.ProtocolBuffers { ...@@ -377,6 +383,7 @@ 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);
} }
...@@ -424,6 +431,7 @@ namespace Google.ProtocolBuffers { ...@@ -424,6 +431,7 @@ namespace Google.ProtocolBuffers {
WriteRawBytes(bytes); WriteRawBytes(bytes);
} }
[CLSCompliant(false)]
public void WriteUInt32NoTag(uint value) { public void WriteUInt32NoTag(uint value) {
WriteRawVarint32(value); WriteRawVarint32(value);
} }
...@@ -454,6 +462,7 @@ namespace Google.ProtocolBuffers { ...@@ -454,6 +462,7 @@ 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));
} }
...@@ -475,6 +484,7 @@ namespace Google.ProtocolBuffers { ...@@ -475,6 +484,7 @@ 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) {
if (position + 5 > limit) { if (position + 5 > limit) {
SlowWriteRawVarint32(value); SlowWriteRawVarint32(value);
...@@ -492,6 +502,7 @@ namespace Google.ProtocolBuffers { ...@@ -492,6 +502,7 @@ namespace Google.ProtocolBuffers {
} }
} }
[CLSCompliant(false)]
public void WriteRawVarint64(ulong value) { public void WriteRawVarint64(ulong value) {
while (true) { while (true) {
if ((value & ~0x7FUL) == 0) { if ((value & ~0x7FUL) == 0) {
...@@ -504,6 +515,7 @@ namespace Google.ProtocolBuffers { ...@@ -504,6 +515,7 @@ namespace Google.ProtocolBuffers {
} }
} }
[CLSCompliant(false)]
public void WriteRawLittleEndian32(uint value) { public void WriteRawLittleEndian32(uint value) {
WriteRawByte((byte)value); WriteRawByte((byte)value);
WriteRawByte((byte)(value >> 8)); WriteRawByte((byte)(value >> 8));
...@@ -511,6 +523,7 @@ namespace Google.ProtocolBuffers { ...@@ -511,6 +523,7 @@ namespace Google.ProtocolBuffers {
WriteRawByte((byte)(value >> 24)); WriteRawByte((byte)(value >> 24));
} }
[CLSCompliant(false)]
public void WriteRawLittleEndian64(ulong value) { public void WriteRawLittleEndian64(ulong value) {
WriteRawByte((byte)value); WriteRawByte((byte)value);
WriteRawByte((byte)(value >> 8)); WriteRawByte((byte)(value >> 8));
...@@ -530,6 +543,7 @@ namespace Google.ProtocolBuffers { ...@@ -530,6 +543,7 @@ 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);
} }
...@@ -599,6 +613,7 @@ namespace Google.ProtocolBuffers { ...@@ -599,6 +613,7 @@ 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);
} }
...@@ -628,6 +643,7 @@ namespace Google.ProtocolBuffers { ...@@ -628,6 +643,7 @@ 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;
} }
...@@ -636,6 +652,7 @@ namespace Google.ProtocolBuffers { ...@@ -636,6 +652,7 @@ 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;
} }
...@@ -699,6 +716,7 @@ namespace Google.ProtocolBuffers { ...@@ -699,6 +716,7 @@ 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);
} }
...@@ -764,6 +782,7 @@ namespace Google.ProtocolBuffers { ...@@ -764,6 +782,7 @@ 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);
} }
...@@ -793,6 +812,7 @@ namespace Google.ProtocolBuffers { ...@@ -793,6 +812,7 @@ 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;
} }
...@@ -801,6 +821,7 @@ namespace Google.ProtocolBuffers { ...@@ -801,6 +821,7 @@ 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;
} }
...@@ -861,6 +882,7 @@ namespace Google.ProtocolBuffers { ...@@ -861,6 +882,7 @@ 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);
} }
...@@ -936,6 +958,7 @@ namespace Google.ProtocolBuffers { ...@@ -936,6 +958,7 @@ 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) return 1; if ((value & (0xffffffff << 7)) == 0) return 1;
if ((value & (0xffffffff << 14)) == 0) return 2; if ((value & (0xffffffff << 14)) == 0) return 2;
...@@ -947,6 +970,7 @@ namespace Google.ProtocolBuffers { ...@@ -947,6 +970,7 @@ 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) return 1; if ((value & (0xffffffffffffffffL << 7)) == 0) return 1;
if ((value & (0xffffffffffffffffL << 14)) == 0) return 2; if ((value & (0xffffffffffffffffL << 14)) == 0) return 2;
...@@ -1035,6 +1059,7 @@ namespace Google.ProtocolBuffers { ...@@ -1035,6 +1059,7 @@ 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
return (uint)((n << 1) ^ (n >> 31)); return (uint)((n << 1) ^ (n >> 31));
...@@ -1049,6 +1074,7 @@ namespace Google.ProtocolBuffers { ...@@ -1049,6 +1074,7 @@ 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));
} }
......
...@@ -6427,6 +6427,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { ...@@ -6427,6 +6427,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public bool HasPositiveIntValue { public bool HasPositiveIntValue {
get { return hasPositiveIntValue; } get { return hasPositiveIntValue; }
} }
[global::System.CLSCompliant(false)]
public ulong PositiveIntValue { public ulong PositiveIntValue {
get { return positiveIntValue_; } get { return positiveIntValue_; }
} }
...@@ -6751,10 +6752,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos { ...@@ -6751,10 +6752,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public bool HasPositiveIntValue { public bool HasPositiveIntValue {
get { return result.HasPositiveIntValue; } get { return result.HasPositiveIntValue; }
} }
[global::System.CLSCompliant(false)]
public ulong PositiveIntValue { public ulong PositiveIntValue {
get { return result.PositiveIntValue; } get { return result.PositiveIntValue; }
set { SetPositiveIntValue(value); } set { SetPositiveIntValue(value); }
} }
[global::System.CLSCompliant(false)]
public Builder SetPositiveIntValue(ulong value) { public Builder SetPositiveIntValue(ulong value) {
result.hasPositiveIntValue = true; result.hasPositiveIntValue = true;
result.positiveIntValue_ = value; result.positiveIntValue_ = value;
......
...@@ -278,6 +278,10 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -278,6 +278,10 @@ namespace Google.ProtocolBuffers.Descriptors {
get { return fieldType; } get { return fieldType; }
} }
public bool IsCLSCompliant {
get { return mappedType != MappedType.UInt32 && mappedType != MappedType.UInt64; }
}
public int FieldNumber { public int FieldNumber {
get { return Proto.Number; } get { return Proto.Number; }
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
...@@ -111,6 +112,7 @@ namespace Google.ProtocolBuffers { ...@@ -111,6 +112,7 @@ 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(CodedInputStream input, UnknownFieldSet.Builder unknownFields, protected override bool ParseUnknownField(CodedInputStream input, UnknownFieldSet.Builder unknownFields,
ExtensionRegistry extensionRegistry, uint tag) { ExtensionRegistry extensionRegistry, uint tag) {
return unknownFields.MergeFieldFrom(input, extensionRegistry, this, tag); return unknownFields.MergeFieldFrom(input, extensionRegistry, this, tag);
......
...@@ -99,6 +99,7 @@ namespace Google.ProtocolBuffers { ...@@ -99,6 +99,7 @@ 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(CodedInputStream input, UnknownFieldSet.Builder unknownFields, protected virtual bool ParseUnknownField(CodedInputStream input, UnknownFieldSet.Builder unknownFields,
ExtensionRegistry extensionRegistry, uint tag) { ExtensionRegistry extensionRegistry, uint tag) {
return unknownFields.MergeFieldFrom(tag, input); return unknownFields.MergeFieldFrom(tag, input);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
...@@ -77,3 +78,4 @@ using System.Runtime.CompilerServices; ...@@ -77,3 +78,4 @@ using System.Runtime.CompilerServices;
"5e09a6084558f989ccde66094f07822808d3a9b922b0e85b912070032e90bb35360be7efb7982b" + "5e09a6084558f989ccde66094f07822808d3a9b922b0e85b912070032e90bb35360be7efb7982b" +
"702d7a5c6ed1e21d8ca587b4f4c9d2b81210d3641cc75f506cdfc628ac5453ff0a6886986c981d" + "702d7a5c6ed1e21d8ca587b4f4c9d2b81210d3641cc75f506cdfc628ac5453ff0a6886986c981d" +
"12245bc7")] "12245bc7")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
...@@ -292,6 +293,7 @@ namespace Google.ProtocolBuffers { ...@@ -292,6 +293,7 @@ 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);
return this; return this;
...@@ -300,6 +302,7 @@ namespace Google.ProtocolBuffers { ...@@ -300,6 +302,7 @@ 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);
return this; return this;
...@@ -308,6 +311,7 @@ namespace Google.ProtocolBuffers { ...@@ -308,6 +311,7 @@ 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);
return this; return this;
......
...@@ -339,6 +339,7 @@ namespace Google.ProtocolBuffers { ...@@ -339,6 +339,7 @@ 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, CodedInputStream input) { public bool MergeFieldFrom(uint tag, CodedInputStream input) {
int number = WireFormat.GetTagFieldNumber(tag); int number = WireFormat.GetTagFieldNumber(tag);
switch (WireFormat.GetTagWireType(tag)) { switch (WireFormat.GetTagWireType(tag)) {
...@@ -408,6 +409,7 @@ namespace Google.ProtocolBuffers { ...@@ -408,6 +409,7 @@ 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) {
throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number."); throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number.");
......
...@@ -58,7 +58,7 @@ namespace Google.ProtocolBuffers { ...@@ -58,7 +58,7 @@ namespace Google.ProtocolBuffers {
internal const int BoolSize = 1; internal const int BoolSize = 1;
#endregion #endregion
[CLSCompliant(false)]
public enum WireType : uint { public enum WireType : uint {
Varint = 0, Varint = 0,
Fixed64 = 1, Fixed64 = 1,
...@@ -87,10 +87,12 @@ namespace Google.ProtocolBuffers { ...@@ -87,10 +87,12 @@ 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;
} }
...@@ -98,6 +100,7 @@ namespace Google.ProtocolBuffers { ...@@ -98,6 +100,7 @@ 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;
} }
...@@ -106,10 +109,12 @@ namespace Google.ProtocolBuffers { ...@@ -106,10 +109,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;
} }
[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));
} }
...@@ -126,6 +131,7 @@ namespace Google.ProtocolBuffers { ...@@ -126,6 +131,7 @@ 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) {
case FieldType.Double: case FieldType.Double:
......
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