aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/WireFormat.cs
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2009-06-05 22:00:05 +0100
committerJon Skeet <skeet@pobox.com>2009-06-05 22:00:05 +0100
commitd6dd0a45608ffc34d53a60cc3db33cb38e6c2a18 (patch)
treed3aa02f1cbea4437b404bc7aa77cbc02f7e398dd /src/ProtocolBuffers/WireFormat.cs
parent0864d30b977e0ae90a111004f597d777ce3082ed (diff)
downloadprotobuf-d6dd0a45608ffc34d53a60cc3db33cb38e6c2a18.tar.gz
protobuf-d6dd0a45608ffc34d53a60cc3db33cb38e6c2a18.tar.bz2
protobuf-d6dd0a45608ffc34d53a60cc3db33cb38e6c2a18.zip
Add CLSCompliance.
Diffstat (limited to 'src/ProtocolBuffers/WireFormat.cs')
-rw-r--r--src/ProtocolBuffers/WireFormat.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ProtocolBuffers/WireFormat.cs b/src/ProtocolBuffers/WireFormat.cs
index 8f723d54..2b850533 100644
--- a/src/ProtocolBuffers/WireFormat.cs
+++ b/src/ProtocolBuffers/WireFormat.cs
@@ -58,7 +58,7 @@ namespace Google.ProtocolBuffers {
internal const int BoolSize = 1;
#endregion
-
+ [CLSCompliant(false)]
public enum WireType : uint {
Varint = 0,
Fixed64 = 1,
@@ -87,10 +87,12 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Given a tag value, determines the wire type (lower 3 bits).
/// </summary>
+ [CLSCompliant(false)]
public static WireType GetTagWireType(uint tag) {
return (WireType) (tag & TagTypeMask);
}
+ [CLSCompliant(false)]
public static bool IsEndGroupTag(uint tag) {
return (WireType)(tag & TagTypeMask) == WireType.EndGroup;
}
@@ -98,6 +100,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Given a tag value, determines the field number (the upper 29 bits).
/// </summary>
+ [CLSCompliant(false)]
public static int GetTagFieldNumber(uint tag) {
return (int) tag >> TagTypeBits;
}
@@ -106,10 +109,12 @@ namespace Google.ProtocolBuffers {
/// Makes a tag value given a field number and wire type.
/// TODO(jonskeet): Should we just have a Tag structure?
/// </summary>
+ [CLSCompliant(false)]
public static uint MakeTag(int fieldNumber, WireType wireType) {
return (uint) (fieldNumber << TagTypeBits) | (uint) wireType;
}
+ [CLSCompliant(false)]
public static uint MakeTag(FieldDescriptor field) {
return MakeTag(field.FieldNumber, GetWireType(field));
}
@@ -126,6 +131,7 @@ namespace Google.ProtocolBuffers {
/// Converts a field type to its wire type. Done with a switch for the sake
/// of speed - this is significantly faster than a dictionary lookup.
/// </summary>
+ [CLSCompliant(false)]
public static WireType GetWireType(FieldType fieldType) {
switch (fieldType) {
case FieldType.Double: