GNOME Bugzilla – Bug 660621
Do not use GINT_TO_POINTER for GType
Last modified: 2012-07-16 20:16:03 UTC
Currently when using Type in a e.g. HashTable, valac uses GINT_TO_POINTER to store the GType. Out of bad experience with GUPnP and Rygel I know that the type id can exceed INT_MAX on 64bit systems. We switched to GSIZE_TO_POINTER in GUPnPResourceFactory due to that.
commit d6bc0cc06f920a40faf778d5a622093ebf06ec05 Author: Jürg Billeter <j@bitron.ch> Date: Mon Jul 16 21:21:05 2012 +0200 codegen: Fix conversion from generic pointer to long integer Fixes bug 660621.
result = new CCodeCastExpression (new CCodeCastExpression (cexpr, "guintptr"), get_ccode_name (actual_type)) That's not what I meant - doesn't that still cut of type id's > INT_MAX ?
(In reply to comment #2) > result = new CCodeCastExpression (new CCodeCastExpression (cexpr, "guintptr"), > get_ccode_name (actual_type)) > > That's not what I meant - doesn't that still cut of type id's > INT_MAX ? gintptr and guintptr are pointer-sized integers, i.e., they are 64-bit on 64-bit systems. What situation do you have in mind where this could cause issues?
ah, sorry, I somehow missed the ptr. nevermind :)