Pass gint/guint pointers instead of enum pointers
authorScott D Phillips <scott.d.phillips@intel.com>
Thu, 17 Nov 2016 18:39:01 +0000 (10:39 -0800)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 18 Nov 2016 12:13:53 +0000 (09:13 -0300)
The underlying integer type for enums are implementation defined and may
not be the same size as gint/guint. So implicitly casting from pointers-
to-enum-types to pointers-to-int-types is unsafe. MSVC warns on these.

https://bugzilla.gnome.org/show_bug.cgi?id=774641

ges/ges-formatter.c
ges/ges-validate.c

index 07fa4eb..b0e8837 100644 (file)
@@ -417,7 +417,7 @@ ges_formatter_get_default (void)
 {
   GList *assets, *tmp;
   GESAsset *ret = NULL;
-  GstRank tmprank, rank = GST_RANK_NONE;
+  guint tmprank, rank = GST_RANK_NONE;
 
   assets = ges_list_assets (GES_TYPE_FORMATTER);
   for (tmp = assets; tmp; tmp = tmp->next) {
index d31980a..86e5a94 100644 (file)
@@ -234,8 +234,8 @@ _edit_container (GstValidateScenario * scenario, GstValidateAction * action)
   gboolean res = FALSE;
 
   gint new_layer_priority = -1;
-  GESEdge edge = GES_EDGE_NONE;
-  GESEditMode mode = GES_EDIT_MODE_NORMAL;
+  guint edge = GES_EDGE_NONE;
+  guint mode = GES_EDIT_MODE_NORMAL;
 
   const gchar *edit_mode_str = NULL, *edge_str = NULL;
   const gchar *clip_name;
@@ -487,7 +487,7 @@ _set_control_source (GstValidateScenario * scenario, GstValidateAction * action)
     binding_type = g_strdup ("direct");
 
   if (source_type == NULL || !g_strcmp0 (source_type, "interpolation")) {
-    GstInterpolationMode mode;
+    guint mode;
 
     source = gst_interpolation_control_source_new ();