glib/gobject
Dan Williams 8e82225aed closure: fix handling of ENUMs and integral return types on 64-bit BE platforms
enums are stored in v_long but need to be marshalled as signed
integers.  On platforms where int is 32 bits, taking the
address of v_long resulted in the wrong 32 bits being marshalled.
So we need to stuff the enum's int-sized value to a temporary
int-sized variable and marshall that instead.

Second, on return, libffi actually returns a pointer to a value
that's sized according to platform conventions, not according to
what the caller requested.  ie if ffi_type_sint was requested, the
value can still be a 64-bit sign-extended long on a 64-bit
architecture like PPC64, thus the caller cannot simply cast
the return value as a pointer to the desired type, but must cast
as a pointer to an integral type and then cast to the desired
type to remove any sign extension complications.

For more information on how to correctly handle libffi return
values, see the following bug, specifically comment 35:

https://bugzilla.redhat.com/show_bug.cgi?id=736489

"For 64-bit ABIs that extend integral returns types to 64-bits, libffi always
returns full 64-bit values that you can truncate in the calling code.   It's
just the way it is has always been.  Please don't change libffi.  I'll document
this clearly for the next version (perhaps there is a mention of this, I
haven't looked yet).

The same is true for returning 8-bit values, for instance, on 32-bit systems.
All ABIs extend those results to the full 32-bits so you need to provide a
properly aligned buffer that's big enough to hold the result."

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-10-05 14:08:22 -05:00
..
tests Remove g_mutex_new()/g_cond_new() in testcases 2011-10-04 19:35:27 -04:00
.gitignore Stop using glib-genmarshal at build time 2011-06-20 17:24:07 -04:00
abicheck.sh Simply symbols files 2011-05-23 00:21:06 -04:00
ChangeLog Update README files to refer to git 2009-03-31 19:39:16 -04:00
gatomicarray.c Remove a redundant assertion 2011-06-14 18:51:57 -04:00
gatomicarray.h Add GAtomicArray for RCU-style lockless updates 2009-11-30 20:48:50 +01:00
gbinding.c Fix annotations for source/target in g_object_bind_property_* 2011-09-22 17:17:54 +01:00
gbinding.h Remove all uses of G_CONST_RETURN 2011-06-09 11:15:40 -04:00
gboxed.c Make GMainLoop, GMainContext and GSource boxed types 2011-08-31 09:37:51 +02:00
gboxed.h GObject: move GLib type definitions to a separate header 2011-05-19 17:39:33 -04:00
gclosure.c closure: fix handling of ENUMs and integral return types on 64-bit BE platforms 2011-10-05 14:08:22 -05:00
gclosure.h Add missing GClosure annotations 2011-08-19 11:44:44 +02:00
genums.c gobject: Use _ prefixing in private headers over G_GNUC_INTERNAL in public headers 2011-06-03 12:40:01 -04:00
genums.h Fix "it's" vs "its" confusion throughout the source. Patch by Will 2009-02-23 04:30:06 +00:00
glib-genmarshal.c gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar() 2011-09-22 20:05:38 -04:00
glib-mkenums.in Fix a typo 2011-02-07 23:46:02 -05:00
glib-types.h Make GMainLoop, GMainContext and GSource boxed types 2011-08-31 09:37:51 +02:00
gmarshal.c gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar() 2011-09-22 20:05:38 -04:00
gmarshal.h Stop using glib-genmarshal at build time 2011-06-20 17:24:07 -04:00
gmarshal.list Stop using glib-genmarshal at build time 2011-06-20 17:24:07 -04:00
gobject_probes.d Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject_trace.h Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject-query.c Use the right binary name in help output. Patch by Hiroyuki Ikezoe. 2008-07-06 02:01:56 +00:00
gobject.c GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gobject.h Spelling fixes 2011-08-29 14:49:32 -04:00
gobject.py Initial support for gdb python macros 2009-09-21 15:39:00 +02:00
gobject.rc.in Update the year in the *.rc.in files 2011-06-07 08:55:31 +08:00
gobject.stp.in Add dtrace and systemtap support for gobject 2010-05-27 14:51:41 -04:00
gobject.symbols gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar() 2011-09-22 20:05:38 -04:00
gobjectnotifyqueue.c notifyqueue: Dedup pspecs when adding 2010-08-06 23:35:24 +02:00
gparam.c locks: drop _INIT macros 2011-10-02 22:33:10 -04:00
gparam.h GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gparamspecs.c GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gparamspecs.h More docs fixes 2010-07-12 17:46:17 -04:00
gsignal.c Spelling fixes 2011-08-29 14:49:32 -04:00
gsignal.h GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gsourceclosure.c Add g_source_set_dummy_callback() 2010-11-26 15:07:28 -05:00
gsourceclosure.h GObject: move GLib type definitions to a separate header 2011-05-19 17:39:33 -04:00
gtype-private.h gobject: Use _ prefixing in private headers over G_GNUC_INTERNAL in public headers 2011-06-03 12:40:01 -04:00
gtype.c Deprecate g_thread_init() 2011-10-04 15:31:49 -04:00
gtype.h GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gtypemodule.c Docs: Changed can not to cannot. 2011-03-24 09:33:55 +01:00
gtypemodule.h Prevent unused variable warnings from G_DEFINE_DYNAMIC_TYPE 2011-01-28 12:26:23 -05:00
gtypeplugin.c gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
gtypeplugin.h Migrating docs. 2008-06-21 18:20:43 +00:00
gvalue.c Add (allow-none) annotation for GValue setters. 2011-08-17 12:55:12 +02:00
gvalue.h GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gvaluearray.c Spelling fixes 2011-08-29 14:49:32 -04:00
gvaluearray.h Migrating docs. 2008-06-22 09:45:13 +00:00
gvaluecollector.h GObject docs: resolve broken links 2011-09-05 18:46:59 -04:00
gvaluetransform.c Clean up gobject/gvaluetransform.c a bit 2011-06-07 08:25:07 +08:00
gvaluetypes.c gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar() 2011-09-22 20:05:38 -04:00
gvaluetypes.h gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar() 2011-09-22 20:05:38 -04:00
libgobject-gdb.py.in Avoid shadowing the dir builtin 2010-12-03 14:08:36 -05:00
Makefile.am Make threads mandatory 2011-09-09 12:41:55 -04:00
makefile.msc.in gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
marshal-genstrings.pl Hacky script to fix up your .msc.in files on windows. Dunno if this is a 2001-08-04 15:49:55 +00:00
testgobject.c gobject: remove -DG_DISABLE_CONST_RETURNS 2011-06-09 11:11:30 -04:00