summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-04-14 14:40:04 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-04-27 10:28:09 +0300
commit4e3cd88c2b9c55b4fd2f93abe7795c4f7b9bf292 (patch)
treeafe57e72b2e5e23a997f7ab3a46f8101527c7d52
parentf8f344923eba57ca13d82e53f3e7b82633179f43 (diff)
downloadglib-4e3cd88c2b9c55b4fd2f93abe7795c4f7b9bf292.tar.gz
gparamspecs: GTypes are stored in v_pointer, not v_long
v_long is 32 bits on Win64, v_pointer is 64 bits. On most other platforms the size of long and pointer is the same, so it's usually not a problem. https://bugzilla.gnome.org/show_bug.cgi?id=758738
-rw-r--r--gobject/gparamspecs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c
index 16c1f55ff..43fc38365 100644
--- a/gobject/gparamspecs.c
+++ b/gobject/gparamspecs.c
@@ -1067,7 +1067,7 @@ param_gtype_set_default (GParamSpec *pspec,
{
GParamSpecGType *tspec = G_PARAM_SPEC_GTYPE (pspec);
- value->data[0].v_long = tspec->is_a_type;
+ value->data[0].v_pointer = GSIZE_TO_POINTER (tspec->is_a_type);
}
static gboolean
@@ -1075,12 +1075,12 @@ param_gtype_validate (GParamSpec *pspec,
GValue *value)
{
GParamSpecGType *tspec = G_PARAM_SPEC_GTYPE (pspec);
- GType gtype = value->data[0].v_long;
+ GType gtype = GPOINTER_TO_SIZE (value->data[0].v_pointer);
guint changed = 0;
if (tspec->is_a_type != G_TYPE_NONE && !g_type_is_a (gtype, tspec->is_a_type))
{
- value->data[0].v_long = tspec->is_a_type;
+ value->data[0].v_pointer = GSIZE_TO_POINTER (tspec->is_a_type);
changed++;
}
@@ -1092,8 +1092,8 @@ param_gtype_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2)
{
- GType p1 = value1->data[0].v_long;
- GType p2 = value2->data[0].v_long;
+ GType p1 = GPOINTER_TO_SIZE (value1->data[0].v_pointer);
+ GType p2 = GPOINTER_TO_SIZE (value2->data[0].v_pointer);
/* not much to compare here, try to at least provide stable lesser/greater result */