Efl.Ui.Flip: Silence warning
authorXavi Artigas <xavierartigas@yahoo.es>
Wed, 29 May 2019 13:13:32 +0000 (15:13 +0200)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 3 Jun 2019 06:42:09 +0000 (15:42 +0900)
The Efl.Ui.Orientation enum is actually made of flags, which we can OR
together, and it includes bitmasks for easier manipulation.
gcc expects switch() statemenets to include all enum values and nothing
but the valid enum values, which is abit too restrictive for flags.
Casting to int removes the warning.

src/lib/elementary/efl_ui_flip.c

index f41cdee..23ce004 100644 (file)
@@ -2044,7 +2044,7 @@ _flip_dir_to_efl_ui_dir(Elm_Flip_Direction dir)
 static Elm_Flip_Direction
 _efl_ui_dir_to_flip_dir(Efl_Ui_Layout_Orientation dir)
 {
-   switch (dir)
+   switch ((int)dir) // The cast silences warnings about missing enum values and non-existing case labels
      {
       case EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL:
         return ELM_FLIP_DIRECTION_RIGHT;