X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FMono%2FDataConverter.cs;h=34ff82ee1d9b02c98a6f6da8078a4f6ada0218f2;hb=039fd253a603d641fe3806e7b1f5eea8bf78e459;hp=f212d684fb5785595311345210b22db84e47e0ea;hpb=4fe075b5581fd0e6b860b701d56697e27ccce06a;p=mono.git diff --git a/mcs/class/corlib/Mono/DataConverter.cs b/mcs/class/corlib/Mono/DataConverter.cs index f212d684fb5..34ff82ee1d9 100644 --- a/mcs/class/corlib/Mono/DataConverter.cs +++ b/mcs/class/corlib/Mono/DataConverter.cs @@ -46,6 +46,10 @@ namespace Mono { unsafe public abstract class DataConverter { #else unsafe internal abstract class DataConverter { + +// Disables the warning: CLS compliance checking will not be performed on +// `XXXX' because it is not visible from outside this assembly +#pragma warning disable 3019 #endif static DataConverter SwapConv = new SwapConverter (); static DataConverter CopyConv = new CopyConverter (); @@ -341,6 +345,8 @@ namespace Mono { // static bool PackOne (PackContext b, object oarg) { + int n; + switch (b.description [b.i]){ case '^': b.conv = BigEndian; @@ -421,7 +427,7 @@ namespace Mono { for (j = b.i+1; j < b.description.Length; j++){ if (b.description [j] == ']') break; - int n = ((short) b.description [j]) - ((short) '0'); + n = ((short) b.description [j]) - ((short) '0'); if (n >= 0 && n <= 9){ if (count == -1) count = n; @@ -437,7 +443,6 @@ namespace Mono { case '$': case 'z': bool add_null = b.description [b.i] == 'z'; - int n; b.i++; if (b.i >= b.description.Length) throw new ArgumentException ("$ description needs a type specified", "description"); @@ -504,7 +509,7 @@ namespace Mono { ArrayList result = new ArrayList (); int idx = startIndex; bool align = false; - int repeat = 0; + int repeat = 0, n; for (int i = 0; i < description.Length && idx < buffer.Length; ){ int save = i; @@ -621,7 +626,7 @@ namespace Mono { for (j = i+1; j < description.Length; j++){ if (description [j] == ']') break; - int n = ((short) description [j]) - ((short) '0'); + n = ((short) description [j]) - ((short) '0'); if (n >= 0 && n <= 9){ if (count == -1) count = n; @@ -637,7 +642,6 @@ namespace Mono { case '$': case 'z': // bool with_null = description [i] == 'z'; - int n; i++; if (i >= description.Length) throw new ArgumentException ("$ description needs a type specified", "description"); @@ -893,7 +897,7 @@ namespace Mono { public override void PutBytes (byte [] dest, int destIdx, double value) { Check (dest, destIdx, 8); - fixed (byte *target = (&dest [destIdx])){ + fixed (byte *target = &dest [destIdx]){ long *source = (long *) &value; *((long *)target) = *source; @@ -1222,8 +1226,9 @@ namespace Mono { for (; i < count; i++) *dest++ = *src++; } else { + dest += count; for (; i < count; i++) - dest [i-count] = *src++; + *(--dest) = *src++; } } @@ -1232,8 +1237,9 @@ namespace Mono { int i = 0; if (BitConverter.IsLittleEndian){ + dest += count; for (; i < count; i++) - dest [i-count] = *src++; + *(--dest) = *src++; } else { for (; i < count; i++) *dest++ = *src++;