Author: toshok
Date: 2007-06-22 02:46:28 -0400 (Fri, 22 Jun 2007)
New Revision: 80527
Modified:
trunk/olive/class/agclr/System.Windows/DependencyObject.cs
Log:
don't use IntPtr.Size to calculate the alignment for 8 byte-aligned struct
elements.
Modified: trunk/olive/class/agclr/System.Windows/DependencyObject.cs
===================================================================
--- trunk/olive/class/agclr/System.Windows/DependencyObject.cs 2007-06-22
06:45:49 UTC (rev 80526)
+++ trunk/olive/class/agclr/System.Windows/DependencyObject.cs 2007-06-22
06:46:28 UTC (rev 80527)
@@ -352,7 +352,7 @@
byte *px = (byte *) x;
k = (Kind) (*((int *)px));
- px += IntPtr.Size;
+ px += 8;
switch (k) {
case Kind.INVALID:
@@ -449,7 +449,7 @@
return Duration.Automatic;
int kind = Marshal.ReadInt32 (vptr);
- long ticks = Marshal.ReadInt64
((IntPtr) ((byte*) vptr + IntPtr.Size));
+ long ticks = Marshal.ReadInt64
((IntPtr) ((byte*) vptr + 8));
return new Duration (kind, new TimeSpan
(ticks));
}
@@ -463,8 +463,8 @@
return KeyTime.Uniform;
int kind = * (int*) (bptr);
- double percent = * (double*) (bptr +
IntPtr.Size);
- long ticks = * (long*) (bptr +
IntPtr.Size + 8);
+ double percent = * (double*) (bptr + 8);
+ long ticks = * (long*) (bptr + 8 +
sizeof(double));
return new KeyTime ((KeyTimeType) kind,
percent, new TimeSpan (ticks));
}
@@ -503,7 +503,7 @@
unsafe {
void *vp = &value;
byte *p = (byte *) vp;
- p += IntPtr.Size;
+ p += 8;
if (v is DependencyObject){
DependencyObject dov =
(DependencyObject) v;
@@ -616,7 +616,7 @@
value.k = Kind.DURATION;
IntPtr result = Marshal.AllocHGlobal
(sizeof (Duration));
Marshal.WriteInt32 (result,
d.KindInternal);
- Marshal.WriteInt64 ((IntPtr) ((byte*)
result + IntPtr.Size), d.TimeSpanInternal.Ticks);
+ Marshal.WriteInt64 ((IntPtr) ((byte*)
result + 8), d.TimeSpanInternal.Ticks);
*((IntPtr *) p) = result;
} else if (v is KeyTime) {
KeyTime k = (KeyTime) v;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches