2009-01-26 Mike Kestner <mkestner@novell.com>

* glib/Value.cs:  make the pad fields a blink explicitly sized struct
	instead to avoid alignment issues on x86. [Fixes #469135]

svn path=/trunk/gtk-sharp/; revision=124561
This commit is contained in:
Mike Kestner 2009-01-26 20:42:50 +00:00
parent 27c413091c
commit 1d9f50edb7
2 changed files with 10 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2009-01-26 Mike Kestner <mkestner@novell.com>
* glib/Value.cs: make the pad fields a blink explicitly sized struct
instead to avoid alignment issues on x86. [Fixes #469135]
2009-01-23 Mike Kestner <mkestner@novell.com> 2009-01-23 Mike Kestner <mkestner@novell.com>
* Makefile.include: * Makefile.include:

View File

@ -30,23 +30,24 @@ namespace GLib {
[StructLayout (LayoutKind.Sequential)] [StructLayout (LayoutKind.Sequential)]
public struct Value : IDisposable { public struct Value : IDisposable {
[StructLayout(LayoutKind.Sequential, Size=16)]
struct Padding {
}
IntPtr type; IntPtr type;
long pad_1; Padding padding;
long pad_2;
public static Value Empty; public static Value Empty;
public Value (GLib.GType gtype) public Value (GLib.GType gtype)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
g_value_init (ref this, gtype.Val); g_value_init (ref this, gtype.Val);
} }
public Value (object obj) public Value (object obj)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
GType gtype = (GType) obj.GetType (); GType gtype = (GType) obj.GetType ();
g_value_init (ref this, gtype.Val); g_value_init (ref this, gtype.Val);
@ -97,7 +98,6 @@ namespace GLib {
public Value (EnumWrapper wrap, string type_name) public Value (EnumWrapper wrap, string type_name)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
g_value_init (ref this, GType.FromName (type_name).Val); g_value_init (ref this, GType.FromName (type_name).Val);
if (wrap.flags) if (wrap.flags)
g_value_set_flags (ref this, (uint) (int) wrap); g_value_set_flags (ref this, (uint) (int) wrap);
@ -130,7 +130,6 @@ namespace GLib {
public Value (Opaque val, string type_name) public Value (Opaque val, string type_name)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
g_value_init (ref this, GType.FromName (type_name).Val); g_value_init (ref this, GType.FromName (type_name).Val);
g_value_set_boxed (ref this, val.Handle); g_value_set_boxed (ref this, val.Handle);
} }
@ -148,7 +147,6 @@ namespace GLib {
public Value (GLib.Object obj, string prop_name) public Value (GLib.Object obj, string prop_name)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
InitForProperty (obj, prop_name); InitForProperty (obj, prop_name);
} }
@ -156,7 +154,6 @@ namespace GLib {
public Value (GLib.Object obj, string prop_name, EnumWrapper wrap) public Value (GLib.Object obj, string prop_name, EnumWrapper wrap)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
InitForProperty (obj.NativeType, prop_name); InitForProperty (obj.NativeType, prop_name);
if (wrap.flags) if (wrap.flags)
g_value_set_flags (ref this, (uint) (int) wrap); g_value_set_flags (ref this, (uint) (int) wrap);
@ -168,7 +165,6 @@ namespace GLib {
public Value (IntPtr obj, string prop_name, Opaque val) public Value (IntPtr obj, string prop_name, Opaque val)
{ {
type = IntPtr.Zero; type = IntPtr.Zero;
pad_1 = pad_2 = 0;
InitForProperty (GLib.Object.GetObject (obj), prop_name); InitForProperty (GLib.Object.GetObject (obj), prop_name);
g_value_set_boxed (ref this, val.Handle); g_value_set_boxed (ref this, val.Handle);
} }