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 ();
//
static bool PackOne (PackContext b, object oarg)
{
+ int n;
+
switch (b.description [b.i]){
case '^':
b.conv = BigEndian;
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;
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");
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;
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;
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");
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;
for (; i < count; i++)
*dest++ = *src++;
} else {
+ dest += count;
for (; i < count; i++)
- dest [i-count] = *src++;
+ *(--dest) = *src++;
}
}
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++;