[gegl] property-type: change GeglParamSpecSeed from int to uint
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] property-type: change GeglParamSpecSeed from int to uint
- Date: Mon, 16 Apr 2018 13:52:11 +0000 (UTC)
commit 1d6e841d78b3634fa186e6dde87b6fec126fed9f
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 16 15:49:36 2018 +0200
property-type: change GeglParamSpecSeed from int to uint
so it matches the value range of GeglRandom's seed. Change
propery_seed() accordingly.
gegl/gegl-op.h | 8 ++++----
gegl/property-types/gegl-paramspecs.c | 10 +++++-----
gegl/property-types/gegl-paramspecs.h | 6 +++---
3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index d155bc5..6ba86b6 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -277,7 +277,7 @@ gegl_module_register (GTypeModule *module)
#define property_pointer(name, label, def_val) ITEM(name,label,def_val,pointer)
#define property_object(name, label, def_val) ITEM2(name,label,def_val,object)
#define property_enum(name, label, enm, enum_name, def_val) ITEM(name,label,def_val,pointer)
-#define property_seed(name, label, rand_name) ITEM(name,label,def_val,int)
+#define property_seed(name, label, rand_name) ITEM(name,label,def_val,uint)
#define property_format(name, label, def_val) ITEM(name,label,def_val,pointer)
#define property_curve(name, label, def_val) ITEM2(name,label,def_val,object)
#define property_path(name, label, def_val) ITEM2(name,label,def_val,object)
@@ -370,7 +370,7 @@ struct _GeglProperties
#define property_pointer(name, label, def_val) gpointer name;
#define property_format(name, label, def_val) gpointer name;
#define property_enum(name, label, enum, enum_name, def_val) enum name;
-#define property_seed(name, label, rand_name) gint name;\
+#define property_seed(name, label, rand_name) guint name;\
GeglRandom *rand_name;
#include GEGL_OP_C_FILE
@@ -416,7 +416,7 @@ enum
#define property_pointer(name, label, def_val) ITEM(name,label,def_val,pointer)
#define property_format(name, label, def_val) ITEM(name,label,def_val,pointer)
#define property_enum(name, label, enm, enum_name, def_val) ITEM(name,label,def_val,enum)
-#define property_seed(name, label, rand_name) ITEM(name,label,def_val,int)
+#define property_seed(name, label, rand_name) ITEM(name,label,def_val,uint)
#include GEGL_OP_C_FILE
@@ -558,7 +558,7 @@ set_property (GObject *gobject,
break;
#define property_seed(name, label, rand_name) \
case PROP_##name: \
- properties->name = g_value_get_int (value); \
+ properties->name = g_value_get_uint (value); \
if (!properties->rand_name) \
properties->rand_name = gegl_random_new_with_seed (properties->name);\
else \
diff --git a/gegl/property-types/gegl-paramspecs.c b/gegl/property-types/gegl-paramspecs.c
index de981f9..c3fdd73 100644
--- a/gegl/property-types/gegl-paramspecs.c
+++ b/gegl/property-types/gegl-paramspecs.c
@@ -577,7 +577,7 @@ gegl_param_seed_get_type (void)
0,
(GInstanceInitFunc) gegl_param_seed_init
};
- type = g_type_register_static (G_TYPE_PARAM_INT,
+ type = g_type_register_static (G_TYPE_PARAM_UINT,
"GeglParamSeed", &info, 0);
}
return type;
@@ -586,7 +586,7 @@ gegl_param_seed_get_type (void)
static void
gegl_param_seed_class_init (GParamSpecClass *klass)
{
- klass->value_type = G_TYPE_INT;
+ klass->value_type = G_TYPE_UINT;
}
static void
@@ -595,7 +595,7 @@ gegl_param_seed_init (GParamSpec *pspec)
GeglParamSpecSeed *gdpspec = GEGL_PARAM_SPEC_SEED (pspec);
gdpspec->ui_minimum = 0;
- gdpspec->ui_maximum = G_MAXINT;
+ gdpspec->ui_maximum = G_MAXUINT;
}
GParamSpec *
@@ -612,10 +612,10 @@ gegl_param_spec_seed (const gchar *name,
ispec = G_PARAM_SPEC_INT (pspec);
ispec->minimum = 0;
- ispec->maximum = G_MAXINT;
+ ispec->maximum = G_MAXUINT;
ispec->default_value = 0;
pspec->ui_minimum = 0;
- pspec->ui_maximum = G_MAXINT;
+ pspec->ui_maximum = G_MAXUINT;
return G_PARAM_SPEC (pspec);
}
diff --git a/gegl/property-types/gegl-paramspecs.h b/gegl/property-types/gegl-paramspecs.h
index 5302a95..46ab03d 100644
--- a/gegl/property-types/gegl-paramspecs.h
+++ b/gegl/property-types/gegl-paramspecs.h
@@ -297,10 +297,10 @@ void gegl_param_spec_enum_exclude_value (GeglParamSpecEnum *espec,
struct _GeglParamSpecSeed
{
- GParamSpecInt parent_instance;
+ GParamSpecUInt parent_instance;
- gint ui_minimum;
- gint ui_maximum;
+ guint ui_minimum;
+ guint ui_maximum;
};
GType gegl_param_seed_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]