region: Remove unreachable code 13/278113/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 13 Jul 2022 03:50:08 +0000 (12:50 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:09:04 +0000 (14:09 +0900)
And this also adds an assert when unknown transform is given.

Change-Id: Ic2e9b01ce2106f02f4a4032f2125a8fa9153ae54

src/region.c

index 92fe003..966fc1a 100644 (file)
@@ -63,14 +63,6 @@ ds_region_transform(pixman_region32_t *dst, pixman_region32_t *src,
 
     for (i = 0; i < nrects; i++) {
         switch (transform) {
-            default:
-                ds_err("Unkown transform value(%d)", transform);
-            case WL_OUTPUT_TRANSFORM_NORMAL:
-                dst_rects[i].x1 = src_rects[i].x1;
-                dst_rects[i].y1 = src_rects[i].y1;
-                dst_rects[i].x2 = src_rects[i].x2;
-                dst_rects[i].y2 = src_rects[i].y2;
-                break; 
             case WL_OUTPUT_TRANSFORM_90:
                 dst_rects[i].x1 = height - src_rects[i].y2;
                 dst_rects[i].y1 = src_rects[i].x1;
@@ -113,6 +105,10 @@ ds_region_transform(pixman_region32_t *dst, pixman_region32_t *src,
                 dst_rects[i].x2 = height - src_rects[i].y1;
                 dst_rects[i].y2 = width - src_rects[i].x1;
                 break;
+            default:
+                ds_err("Unkown transform value(%d)", transform);
+                assert(0 && "Cannot reach here");
+                break;
        }
     }