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>
* Makefile.include:

View File

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