Beispiel #1
0
        public void TestPadded()
        {
            var obj = new Padded {
                B = 1, L = 2
            };

            Assert.AreEqual(Padded.DebuggerSize, obj.GetExclusiveSize());
        }
Beispiel #2
0
    public static unsafe void Main (string[] args) {
        var buffer = new byte[32];

        fixed (byte *pBuffer = buffer) {
            Array.Clear(buffer, 0, 32);
            *((Padded*)pBuffer) = new Padded { A = 0x1B, B = 0xFAEBDCCD, C = 3.3f };
            Util.PrintBytes(buffer);
            Console.WriteLine(*((Padded*)pBuffer));

            Console.WriteLine(Marshal.SizeOf(typeof(Padded)));
        }
    }
Beispiel #3
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if (isset.padded)
                {
                    hashcode = (hashcode * 397) + Padded.GetHashCode();
                }
                if (isset.logical)
                {
                    hashcode = (hashcode * 397) + Logical.GetHashCode();
                }
            }
            return(hashcode);
        }
Beispiel #4
0
    public static unsafe void Main(string[] args)
    {
        var buffer = new byte[32];

        fixed(byte *pBuffer = buffer)
        {
            Array.Clear(buffer, 0, 32);
            *((Padded *)pBuffer) = new Padded {
                A = 0x1B, B = 0xFAEBDCCD, C = 3.3f
            };
            Util.PrintBytes(buffer);
            Console.WriteLine(*((Padded *)pBuffer));

            Console.WriteLine(Marshal.SizeOf(typeof(Padded)));
        }
    }