scale.c: Use int instead of kernel_t for values in named_int_t
authorSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 10 Oct 2013 02:05:59 +0000 (22:05 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Sat, 12 Oct 2013 19:04:27 +0000 (15:04 -0400)
The 'value' field in the 'named_int_t' struct is used for both
pixman_repeat_t and pixman_kernel_t values, so the type should be int,
not pixman_kernel_t.

Fixes some warnings like this

scale.c:124:33: warning: implicit conversion from enumeration
      type 'pixman_repeat_t' to different enumeration type
      'pixman_kernel_t' [-Wconversion]
    { "None",                   PIXMAN_REPEAT_NONE },
    ~                           ^~~~~~~~~~~~~~~~~~

when compiled with clang.

demos/scale.c

index 869ada1..d00307e 100644 (file)
@@ -103,8 +103,8 @@ compute_extents (pixman_f_transform_t *trans, double *sx, double *sy)
 
 typedef struct
 {
-    char               name [20];
-    pixman_kernel_t    value;
+    char       name [20];
+    int                value;
 } named_int_t;
 
 static const named_int_t filters[] =
@@ -127,7 +127,7 @@ static const named_int_t repeats[] =
     { "Pad",                    PIXMAN_REPEAT_PAD },
 };
 
-static pixman_kernel_t
+static int
 get_value (app_t *app, const named_int_t table[], const char *box_name)
 {
     GtkComboBox *box = GTK_COMBO_BOX (get_widget (app, box_name));