diff options
author | Marius Strobl <marius@FreeBSD.org> | 2010-05-31 16:42:42 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2010-05-31 16:42:42 +0000 |
commit | b273fd6a6e86b52fab135b303314a3cad38a84d1 (patch) | |
tree | 0843a20770b3a32e0d8c65d2f2ba6feb7ab99bf4 /devel/gobject-introspection | |
parent | 9ab0a89c78030091cb7d3987c1fc0f5f3a0e85b4 (diff) |
Notes
Diffstat (limited to 'devel/gobject-introspection')
-rw-r--r-- | devel/gobject-introspection/files/patch-girepository_ginfo.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/devel/gobject-introspection/files/patch-girepository_ginfo.c b/devel/gobject-introspection/files/patch-girepository_ginfo.c new file mode 100644 index 000000000000..f013ff9aa1f8 --- /dev/null +++ b/devel/gobject-introspection/files/patch-girepository_ginfo.c @@ -0,0 +1,46 @@ +--- girepository/ginfo.c.orig 2010-05-19 02:39:46.000000000 +0000 ++++ girepository/ginfo.c 2010-05-30 21:11:54.000000000 +0000 +@@ -69,6 +69,9 @@ + const gchar *namespace; + }; + ++#define DO_ALIGNED_COPY(dest_addr, src_addr, type) \ ++ memcpy((dest_addr), (src_addr), sizeof(type)) ++ + #define INVALID_REFCOUNT 0x7FFFFFFF + + static void +@@ -2349,16 +2352,16 @@ + value->v_uint32 = *(guint32*)&rinfo->typelib->data[blob->offset]; + break; + case GI_TYPE_TAG_INT64: +- value->v_int64 = *(gint64*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_int64, &rinfo->typelib->data[blob->offset], gint64); + break; + case GI_TYPE_TAG_UINT64: +- value->v_uint64 = *(guint64*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_uint64, &rinfo->typelib->data[blob->offset], guint64); + break; + case GI_TYPE_TAG_FLOAT: +- value->v_float = *(gfloat*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_float, &rinfo->typelib->data[blob->offset], gfloat); + break; + case GI_TYPE_TAG_DOUBLE: +- value->v_double = *(gdouble*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_double, &rinfo->typelib->data[blob->offset], gdouble); + break; + case GI_TYPE_TAG_TIME_T: + value->v_long = *(long*)&rinfo->typelib->data[blob->offset]; +@@ -2376,10 +2379,10 @@ + value->v_uint = *(guint*)&rinfo->typelib->data[blob->offset]; + break; + case GI_TYPE_TAG_LONG: +- value->v_long = *(glong*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_long, &rinfo->typelib->data[blob->offset], glong); + break; + case GI_TYPE_TAG_ULONG: +- value->v_ulong = *(gulong*)&rinfo->typelib->data[blob->offset]; ++ DO_ALIGNED_COPY(&value->v_ulong, &rinfo->typelib->data[blob->offset], gulong); + break; + } + } |