From 5c3ef4e9798f3395c55fe7b57df32f77c0de2c71 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 17 Sep 2009 13:18:22 +0200 Subject: [PATCH] Fix compile warnings --- pixman/pixman-fast-path.c | 2 ++ pixman/pixman-mmx.c | 2 ++ test/alpha-test.c | 10 +++++----- test/blitters-test.c | 3 ++- test/clip-test.c | 2 ++ test/composite-test.c | 5 ++++- test/gradient-test.c | 8 +++++--- test/utils.h | 7 +++++++ 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 25f6016..c053229 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -723,6 +723,7 @@ fast_composite_over_8888_8888 (pixman_implementation_t *imp, } } +#if 0 static void fast_composite_over_8888_0888 (pixman_implementation_t *imp, pixman_op_t op, @@ -773,6 +774,7 @@ fast_composite_over_8888_0888 (pixman_implementation_t *imp, } } } +#endif static void fast_composite_over_8888_0565 (pixman_implementation_t *imp, diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 3595742..aaddff5 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -3153,6 +3153,7 @@ mmx_composite_copy_area (pixman_implementation_t *imp, src_x, src_y, dest_x, dest_y, width, height); } +#if 0 static void mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp, pixman_op_t op, @@ -3219,6 +3220,7 @@ mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp, _mm_empty (); } +#endif static const pixman_fast_path_t mmx_fast_paths[] = { diff --git a/test/alpha-test.c b/test/alpha-test.c index e2b97c7..fd6b2ec 100644 --- a/test/alpha-test.c +++ b/test/alpha-test.c @@ -14,7 +14,6 @@ main (int argc, char **argv) uint32_t *src = malloc (WIDTH * HEIGHT * 4); pixman_image_t *grad_img; pixman_image_t *alpha_img; - pixman_image_t *solid_img; pixman_image_t *dest_img; pixman_image_t *src_img; int i; @@ -26,24 +25,25 @@ main (int argc, char **argv) pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 }; pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH), pixman_int_to_fixed (0) }; +#if 0 pixman_transform_t trans = { { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), }, { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), }, { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } } }; - - pixman_transform_t id = { +#else + pixman_transform_t trans = { { { pixman_fixed_1, 0, 0 }, { 0, pixman_fixed_1, 0 }, { 0, 0, pixman_fixed_1 } } }; +#endif pixman_point_fixed_t c_inner; pixman_point_fixed_t c_outer; pixman_fixed_t r_inner; pixman_fixed_t r_outer; - pixman_color_t red = { 0xffff, 0x0000, 0x0000, 0xffff }; for (i = 0; i < WIDTH * HEIGHT; ++i) alpha[i] = 0x4f00004f; /* pale blue */ @@ -91,7 +91,7 @@ main (int argc, char **argv) grad_img = pixman_image_create_linear_gradient (&p1, &p2, stops, 2); - pixman_image_set_transform (grad_img, &id); + pixman_image_set_transform (grad_img, &trans); pixman_image_set_repeat (grad_img, PIXMAN_REPEAT_PAD); pixman_image_composite (PIXMAN_OP_OVER, grad_img, NULL, alpha_img, diff --git a/test/blitters-test.c b/test/blitters-test.c index 569e946..b8b6eba 100644 --- a/test/blitters-test.c +++ b/test/blitters-test.c @@ -56,7 +56,8 @@ aligned_malloc (size_t align, size_t size) void *result; #ifdef HAVE_POSIX_MEMALIGN - posix_memalign (&result, align, size); + if (posix_memalign (&result, align, size) != 0) + result = NULL; #else result = malloc (size); #endif diff --git a/test/clip-test.c b/test/clip-test.c index 9000137..cbab447 100644 --- a/test/clip-test.c +++ b/test/clip-test.c @@ -31,9 +31,11 @@ main (int argc, char **argv) { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } }, { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } } }; +#if 0 pixman_point_fixed_t p1 = { 0, 0 }; pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH), pixman_int_to_fixed (HEIGHT) }; +#endif pixman_point_fixed_t c_inner; pixman_point_fixed_t c_outer; pixman_fixed_t r_inner; diff --git a/test/composite-test.c b/test/composite-test.c index 49e0220..2f14502 100644 --- a/test/composite-test.c +++ b/test/composite-test.c @@ -77,6 +77,9 @@ writer (void *src, uint32_t value, int size) case 4: *(uint32_t *)src = value; break; + + default: + break; } } @@ -113,7 +116,7 @@ main (int argc, char **argv) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size (window, 800, 600); + gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), diff --git a/test/gradient-test.c b/test/gradient-test.c index 2593ee3..c95c714 100644 --- a/test/gradient-test.c +++ b/test/gradient-test.c @@ -21,18 +21,20 @@ main (int argc, char **argv) pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 }; pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH / 8.), pixman_int_to_fixed (0) }; +#if 0 pixman_transform_t trans = { { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), }, { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), }, { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } } }; - - pixman_transform_t id = { +#else + pixman_transform_t trans = { { { pixman_fixed_1, 0, 0 }, { 0, pixman_fixed_1, 0 }, { 0, 0, pixman_fixed_1 } } }; +#endif pixman_point_fixed_t c_inner; pixman_point_fixed_t c_outer; @@ -67,7 +69,7 @@ main (int argc, char **argv) src_img = pixman_image_create_linear_gradient (&p1, &p2, stops, 2); - pixman_image_set_transform (src_img, &id); + pixman_image_set_transform (src_img, &trans); pixman_image_set_repeat (src_img, PIXMAN_REPEAT_PAD); pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img, diff --git a/test/utils.h b/test/utils.h index bc110d8..2cb13bc 100644 --- a/test/utils.h +++ b/test/utils.h @@ -1,6 +1,13 @@ #include #include #include +#include #include "pixman.h" void show_image (pixman_image_t *image); + +GdkPixbuf *pixbuf_from_argb32 (uint32_t *bits, + gboolean has_alpha, + int width, + int height, + int stride); -- 2.7.4