summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-09-17 13:19:04 +0200
committerBenjamin Otte <otte@gnome.org>2009-10-20 00:40:40 +0200
commitfa49ef81f7b39d32b626ed235958448835e2d2c2 (patch)
treeb8f918908e9d371184a900c3b9e7fd0feaa31d89
parent5c3ef4e9798f3395c55fe7b57df32f77c0de2c71 (diff)
Add default cases for all switch statements
Fixes compilation with -Wswitch-default. Compilation with -Wswitch-enums works fine as is.
-rw-r--r--pixman/pixman-bits-image.c6
-rw-r--r--pixman/pixman-edge.c3
-rw-r--r--pixman/pixman-image.c4
-rw-r--r--test/composite.c18
-rw-r--r--test/scaling-test.c3
5 files changed, 34 insertions, 0 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 4e78ce10..9e93623e 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -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;
diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c
index 81a2e960..ab9bea0f 100644
--- a/pixman/pixman-edge.c
+++ b/pixman/pixman-edge.c
@@ -358,6 +358,9 @@ PIXMAN_RASTERIZE_EDGES (pixman_image_t *image,
case 8:
rasterize_edges_8 (image, l, r, t, b);
break;
+
+ default:
+ break;
}
}
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index bba5fd68..59db840b 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -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
diff --git a/test/composite.c b/test/composite.c
index 79962514..594e8cc3 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -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;
diff --git a/test/scaling-test.c b/test/scaling-test.c
index 8899c594..c158c23c 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -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);