OSDN Git Service

Use enum's type name to fix implicit conversion
authorVictor Toso <me@victortoso.com>
Tue, 19 Dec 2017 07:07:40 +0000 (08:07 +0100)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 10 Jan 2018 01:12:43 +0000 (09:12 +0800)
The implicit conversion happens because there is another enum defined with
the name GEN9_HEVC_ENC_SURFACE_TYPE introduced in the same commit 455351f9

To avoid the several warnings below (by clang), let's use the enum's
defined type name.

gen9_hevc_encoder.c:5754:34: warning: implicit conversion from
enumeration type 'enum _GEN9_HEVC_ENC_SURFACE_TYPE' to different
enumeration type 'enum GEN9_HEVC_ENC_SURFACE_TYPE' [-Wenum-conversion]
     HEVC_ENC_SURFACE_Y_2X, bti_idx,
     ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
src/gen9_hevc_encoder.c

index ccd862d..a5448b2 100644 (file)
@@ -783,7 +783,7 @@ static void
 gen9_hevc_set_gpe_1d_surface(VADriverContextP ctx,
                              struct gen9_hevc_encoder_context *priv_ctx,
                              struct i965_gpe_context *gpe_context,
-                             enum GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
+                             GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
                              int bti_idx,
                              int is_raw_buffer,
                              int size,
@@ -812,7 +812,7 @@ static void
 gen9_hevc_set_gpe_2d_surface(VADriverContextP ctx,
                              struct gen9_hevc_encoder_context *priv_ctx,
                              struct i965_gpe_context *gpe_context,
-                             enum GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
+                             GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
                              int bti_idx,
                              int has_uv_surface,
                              int is_media_block_rw,
@@ -850,7 +850,7 @@ static void
 gen9_hevc_set_gpe_adv_surface(VADriverContextP ctx,
                               struct gen9_hevc_encoder_context *priv_ctx,
                               struct i965_gpe_context *gpe_context,
-                              enum GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
+                              GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
                               int bti_idx,
                               struct object_surface *surface_object)
 {
@@ -864,7 +864,7 @@ gen9_hevc_set_gpe_adv_surface(VADriverContextP ctx,
 
 static void
 gen9_hevc_add_gpe_surface(struct gen9_hevc_encoder_context *priv_ctx,
-                          enum GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
+                          GEN9_HEVC_ENC_SURFACE_TYPE surface_type,
                           struct i965_gpe_resource *gpe_buffer,
                           struct object_surface *surface_object)
 {