Add default cases for all switch statements
authorBenjamin Otte <otte@gnome.org>
Thu, 17 Sep 2009 11:19:04 +0000 (13:19 +0200)
committerBenjamin Otte <otte@gnome.org>
Mon, 19 Oct 2009 22:40:40 +0000 (00:40 +0200)
Fixes compilation with -Wswitch-default. Compilation with -Wswitch-enums
works fine as is.

pixman/pixman-bits-image.c
pixman/pixman-edge.c
pixman/pixman-image.c
test/composite.c
test/scaling-test.c

index 4e78ce1..9e93623 100644 (file)
@@ -157,6 +157,9 @@ repeat (pixman_repeat_t repeat, int size, int *coord)
 
     case PIXMAN_REPEAT_NONE:
        break;
+
+    default:
+        break;
     }
 }
 
@@ -339,6 +342,9 @@ bits_image_fetch_pixel_filtered (bits_image_t *image,
     case PIXMAN_FILTER_CONVOLUTION:
        return bits_image_fetch_pixel_convolution (image, x, y);
        break;
+
+    default:
+        break;
     }
 
     return 0;
index 81a2e96..ab9bea0 100644 (file)
@@ -358,6 +358,9 @@ PIXMAN_RASTERIZE_EDGES (pixman_image_t *image,
     case 8:
        rasterize_edges_8 (image, l, r, t, b);
        break;
+
+    default:
+        break;
     }
 }
 
index bba5fd6..59db840 100644 (file)
@@ -593,6 +593,10 @@ _pixman_image_is_opaque (pixman_image_t *image)
        if (ALPHA_8 (image->solid.color) != 0xff)
            return FALSE;
        break;
+
+    default:
+        return FALSE;
+        break;
     }
 
     /* Convolution filters can introduce translucency if the sum of the
index 7996251..594e8cc 100644 (file)
@@ -407,6 +407,22 @@ calc_op (pixman_op_t op, double src, double dst, double srca, double dsta)
            Fb = max (0.0, 1.0 - srca / dsta);
        return mult_chan (src, dst, Fa, Fb);
 
+    case PIXMAN_OP_MULTIPLY:
+    case PIXMAN_OP_SCREEN:
+    case PIXMAN_OP_OVERLAY:
+    case PIXMAN_OP_DARKEN:
+    case PIXMAN_OP_LIGHTEN:
+    case PIXMAN_OP_COLOR_DODGE:
+    case PIXMAN_OP_COLOR_BURN:
+    case PIXMAN_OP_HARD_LIGHT:
+    case PIXMAN_OP_SOFT_LIGHT:
+    case PIXMAN_OP_DIFFERENCE:
+    case PIXMAN_OP_EXCLUSION:
+    case PIXMAN_OP_HSL_HUE:
+    case PIXMAN_OP_HSL_SATURATION:
+    case PIXMAN_OP_HSL_COLOR:
+    case PIXMAN_OP_HSL_LUMINOSITY:
+    case PIXMAN_OP_NONE:
     default:
        abort();
     }
@@ -866,6 +882,8 @@ main (void)
                            ok = composite_test (&dst, op, &src, &mask,
                                                 mask.size? TRUE : FALSE);
                            break;
+                        default:
+                            break;
                        }
                        group_ok = group_ok && ok;
                        tests_passed += ok;
index 8899c59..c158c23 100644 (file)
@@ -326,6 +326,9 @@ test_composite (uint32_t initcrc,
     case 3:
        repeat = PIXMAN_REPEAT_REFLECT;
        break;
+
+    default:
+        break;
     }
     pixman_image_set_repeat (src_img, repeat);